Google Cloud Spanner v1 API - Class SessionPool.SessionPoolSegmentKey (5.0.0-beta01)

public sealed class SessionPool.SessionPoolSegmentKey : IEquatable<SessionPool.SessionPoolSegmentKey>

Reference documentation and code samples for the Google Cloud Spanner v1 API class SessionPool.SessionPoolSegmentKey.

Aspects under which a session pool is segmented.

Inheritance

object > SessionPool.SessionPoolSegmentKey

Namespace

Google.Cloud.Spanner.V1

Assembly

Google.Cloud.Spanner.V1.dll

Properties

DatabaseName

public DatabaseName DatabaseName { get; }

The database for which sessions are pooled on the associated session pool.

Property Value
TypeDescription
Google.Cloud.Spanner.Common.V1.DatabaseName

DatabaseRole

public string DatabaseRole { get; }

The database role of the sessions pooled on the associated session pool.

Property Value
TypeDescription
string

Methods

Create(DatabaseName)

public static SessionPool.SessionPoolSegmentKey Create(DatabaseName databaseName)

Creates a SessionPool.SessionPoolSegmentKey with the given database name.

Parameter
NameDescription
databaseNameGoogle.Cloud.Spanner.Common.V1.DatabaseName

The database name for the associated pool. Must not be null.

Returns
TypeDescription
SessionPoolSessionPoolSegmentKey

GetHashCode()

public override int GetHashCode()

Serves as the default hash function.

Returns
TypeDescription
int

A hash code for the current object.

Overrides

ToString()

public override string ToString()

Returns a string that represents the current object.

Returns
TypeDescription
string

A string that represents the current object.

Overrides

WithDatabaseRole(string)

public SessionPool.SessionPoolSegmentKey WithDatabaseRole(string databaseRole)

Creates a SessionPool.SessionPoolSegmentKey based on this one but with the given database role.

Parameter
NameDescription
databaseRolestring

The database role for the associated pool. May be null in which case the default (public) database role is used if fine grained access control is enabled; otherwise the database role is ignored.

Returns
TypeDescription
SessionPoolSessionPoolSegmentKey