Cloud Spanner V1 Client - Class Group (2.1.0)

Reference documentation and code samples for the Cloud Spanner V1 Client class Group.

A Group represents a paxos group in a database. A group is a set of tablets that are replicated across multiple servers. Groups may have a leader tablet. Groups store one (or sometimes more) ranges of keys.

Generated from protobuf message google.spanner.v1.Group

Namespace

Google \ Cloud \ Spanner \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ group_uid int|string

The UID of the paxos group, unique within the database. Matches the group_uid field in Range.

↳ tablets array<Tablet>

A list of tablets that are part of the group. Note that this list may not be exhaustive; it will only include tablets the server considers useful to the client. The returned list is ordered ascending by distance. Tablet UIDs reference Tablet.tablet_uid.

↳ leader_index int

The last known leader tablet of the group as an index into tablets. May be negative if the group has no known leader.

↳ generation string

generation indicates the freshness of the group information (including leader information) contained in this proto. Generations can be compared lexicographically; if generation A is greater than generation B, then the Group corresponding to A is newer than the Group corresponding to B, and should be used preferentially.

getGroupUid

The UID of the paxos group, unique within the database. Matches the group_uid field in Range.

Returns
Type Description
int|string

setGroupUid

The UID of the paxos group, unique within the database. Matches the group_uid field in Range.

Parameter
Name Description
var int|string
Returns
Type Description
$this

getTablets

A list of tablets that are part of the group. Note that this list may not be exhaustive; it will only include tablets the server considers useful to the client. The returned list is ordered ascending by distance.

Tablet UIDs reference Tablet.tablet_uid.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setTablets

A list of tablets that are part of the group. Note that this list may not be exhaustive; it will only include tablets the server considers useful to the client. The returned list is ordered ascending by distance.

Tablet UIDs reference Tablet.tablet_uid.

Parameter
Name Description
var array<Tablet>
Returns
Type Description
$this

getLeaderIndex

The last known leader tablet of the group as an index into tablets. May be negative if the group has no known leader.

Returns
Type Description
int

setLeaderIndex

The last known leader tablet of the group as an index into tablets. May be negative if the group has no known leader.

Parameter
Name Description
var int
Returns
Type Description
$this

getGeneration

generation indicates the freshness of the group information (including leader information) contained in this proto. Generations can be compared lexicographically; if generation A is greater than generation B, then the Group corresponding to A is newer than the Group corresponding to B, and should be used preferentially.

Returns
Type Description
string

setGeneration

generation indicates the freshness of the group information (including leader information) contained in this proto. Generations can be compared lexicographically; if generation A is greater than generation B, then the Group corresponding to A is newer than the Group corresponding to B, and should be used preferentially.

Parameter
Name Description
var string
Returns
Type Description
$this