Class ChangeStreamRecord.PartitionEventRecord (6.96.1)

public static final class ChangeStreamRecord.PartitionEventRecord extends GeneratedMessageV3 implements ChangeStreamRecord.PartitionEventRecordOrBuilder

A partition event record describes key range changes for a change stream partition. The changes to a row defined by its primary key can be captured in one change stream partition for a specific time range, and then be captured in a different change stream partition for a different time range. This movement of key ranges across change stream partitions is a reflection of activities, such as Spanner's dynamic splitting and load balancing, etc. Processing this event is needed if users want to guarantee processing of the changes for any key in timestamp order. If time ordered processing of changes for a primary key is not needed, this event can be ignored. To guarantee time ordered processing for each primary key, if the event describes move-ins, the reader of this partition needs to wait until the readers of the source partitions have processed all records with timestamps <= this PartitionEventRecord.commit_timestamp, before advancing beyond this PartitionEventRecord. If the event describes move-outs, the reader can notify the readers of the destination partitions that they can continue processing.

Protobuf type google.spanner.v1.ChangeStreamRecord.PartitionEventRecord

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > ChangeStreamRecord.PartitionEventRecord

Static Fields

COMMIT_TIMESTAMP_FIELD_NUMBER

public static final int COMMIT_TIMESTAMP_FIELD_NUMBER
Field Value
Type Description
int

MOVE_IN_EVENTS_FIELD_NUMBER

public static final int MOVE_IN_EVENTS_FIELD_NUMBER
Field Value
Type Description
int

MOVE_OUT_EVENTS_FIELD_NUMBER

public static final int MOVE_OUT_EVENTS_FIELD_NUMBER
Field Value
Type Description
int

PARTITION_TOKEN_FIELD_NUMBER

public static final int PARTITION_TOKEN_FIELD_NUMBER
Field Value
Type Description
int

RECORD_SEQUENCE_FIELD_NUMBER

public static final int RECORD_SEQUENCE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static ChangeStreamRecord.PartitionEventRecord getDefaultInstance()
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static ChangeStreamRecord.PartitionEventRecord.Builder newBuilder()
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord.Builder

newBuilder(ChangeStreamRecord.PartitionEventRecord prototype)

public static ChangeStreamRecord.PartitionEventRecord.Builder newBuilder(ChangeStreamRecord.PartitionEventRecord prototype)
Parameter
Name Description
prototype ChangeStreamRecord.PartitionEventRecord
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord.Builder

parseDelimitedFrom(InputStream input)

public static ChangeStreamRecord.PartitionEventRecord parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ChangeStreamRecord.PartitionEventRecord parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ChangeStreamRecord.PartitionEventRecord parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<ChangeStreamRecord.PartitionEventRecord> parser()
Returns
Type Description
Parser<PartitionEventRecord>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCommitTimestamp()

public Timestamp getCommitTimestamp()

Indicates the commit timestamp at which the key range change occurred. DataChangeRecord.commit_timestamps, PartitionStartRecord.start_timestamps, PartitionEventRecord.commit_timestamps, and PartitionEndRecord.end_timestamps can have the same value in the same partition.

.google.protobuf.Timestamp commit_timestamp = 1;

Returns
Type Description
Timestamp

The commitTimestamp.

getCommitTimestampOrBuilder()

public TimestampOrBuilder getCommitTimestampOrBuilder()

Indicates the commit timestamp at which the key range change occurred. DataChangeRecord.commit_timestamps, PartitionStartRecord.start_timestamps, PartitionEventRecord.commit_timestamps, and PartitionEndRecord.end_timestamps can have the same value in the same partition.

.google.protobuf.Timestamp commit_timestamp = 1;

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public ChangeStreamRecord.PartitionEventRecord getDefaultInstanceForType()
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord

getMoveInEvents(int index)

public ChangeStreamRecord.PartitionEventRecord.MoveInEvent getMoveInEvents(int index)

Set when one or more key ranges are moved into the change stream partition identified by partition_token.

Example: Two key ranges are moved into partition (P1) from partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_in_events { source_partition_token: "P2" } move_in_events { source_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_out_events { destination_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_out_events { destination_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4;

Parameter
Name Description
index int
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord.MoveInEvent

getMoveInEventsCount()

public int getMoveInEventsCount()

Set when one or more key ranges are moved into the change stream partition identified by partition_token.

Example: Two key ranges are moved into partition (P1) from partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_in_events { source_partition_token: "P2" } move_in_events { source_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_out_events { destination_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_out_events { destination_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4;

Returns
Type Description
int

getMoveInEventsList()

public List<ChangeStreamRecord.PartitionEventRecord.MoveInEvent> getMoveInEventsList()

Set when one or more key ranges are moved into the change stream partition identified by partition_token.

Example: Two key ranges are moved into partition (P1) from partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_in_events { source_partition_token: "P2" } move_in_events { source_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_out_events { destination_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_out_events { destination_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4;

Returns
Type Description
List<MoveInEvent>

getMoveInEventsOrBuilder(int index)

public ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder getMoveInEventsOrBuilder(int index)

Set when one or more key ranges are moved into the change stream partition identified by partition_token.

Example: Two key ranges are moved into partition (P1) from partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_in_events { source_partition_token: "P2" } move_in_events { source_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_out_events { destination_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_out_events { destination_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4;

Parameter
Name Description
index int
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder

getMoveInEventsOrBuilderList()

public List<? extends ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder> getMoveInEventsOrBuilderList()

Set when one or more key ranges are moved into the change stream partition identified by partition_token.

Example: Two key ranges are moved into partition (P1) from partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_in_events { source_partition_token: "P2" } move_in_events { source_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_out_events { destination_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_out_events { destination_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent move_in_events = 4;

Returns
Type Description
List<? extends com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEventOrBuilder>

getMoveOutEvents(int index)

public ChangeStreamRecord.PartitionEventRecord.MoveOutEvent getMoveOutEvents(int index)

Set when one or more key ranges are moved out of the change stream partition identified by partition_token.

Example: Two key ranges are moved out of partition (P1) to partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_out_events { destination_partition_token: "P2" } move_out_events { destination_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_in_events { source_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_in_events { source_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5;

Parameter
Name Description
index int
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord.MoveOutEvent

getMoveOutEventsCount()

public int getMoveOutEventsCount()

Set when one or more key ranges are moved out of the change stream partition identified by partition_token.

Example: Two key ranges are moved out of partition (P1) to partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_out_events { destination_partition_token: "P2" } move_out_events { destination_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_in_events { source_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_in_events { source_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5;

Returns
Type Description
int

getMoveOutEventsList()

public List<ChangeStreamRecord.PartitionEventRecord.MoveOutEvent> getMoveOutEventsList()

Set when one or more key ranges are moved out of the change stream partition identified by partition_token.

Example: Two key ranges are moved out of partition (P1) to partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_out_events { destination_partition_token: "P2" } move_out_events { destination_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_in_events { source_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_in_events { source_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5;

Returns
Type Description
List<MoveOutEvent>

getMoveOutEventsOrBuilder(int index)

public ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder getMoveOutEventsOrBuilder(int index)

Set when one or more key ranges are moved out of the change stream partition identified by partition_token.

Example: Two key ranges are moved out of partition (P1) to partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_out_events { destination_partition_token: "P2" } move_out_events { destination_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_in_events { source_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_in_events { source_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5;

Parameter
Name Description
index int
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder

getMoveOutEventsOrBuilderList()

public List<? extends ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder> getMoveOutEventsOrBuilderList()

Set when one or more key ranges are moved out of the change stream partition identified by partition_token.

Example: Two key ranges are moved out of partition (P1) to partition (P2) and partition (P3) in a single transaction at timestamp T.

The PartitionEventRecord returned in P1 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P1" move_out_events { destination_partition_token: "P2" } move_out_events { destination_partition_token: "P3" } }

The PartitionEventRecord returned in P2 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P2" move_in_events { source_partition_token: "P1" } }

The PartitionEventRecord returned in P3 will reflect the move as:

PartitionEventRecord { commit_timestamp: T partition_token: "P3" move_in_events { source_partition_token: "P1" } }

repeated .google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent move_out_events = 5;

Returns
Type Description
List<? extends com.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEventOrBuilder>

getParserForType()

public Parser<ChangeStreamRecord.PartitionEventRecord> getParserForType()
Returns
Type Description
Parser<PartitionEventRecord>
Overrides

getPartitionToken()

public String getPartitionToken()

Unique partition identifier describing the partition this event occurred on. partition_token is equal to the partition token of the change stream partition currently queried to return this PartitionEventRecord.

string partition_token = 3;

Returns
Type Description
String

The partitionToken.

getPartitionTokenBytes()

public ByteString getPartitionTokenBytes()

Unique partition identifier describing the partition this event occurred on. partition_token is equal to the partition token of the change stream partition currently queried to return this PartitionEventRecord.

string partition_token = 3;

Returns
Type Description
ByteString

The bytes for partitionToken.

getRecordSequence()

public String getRecordSequence()

Record sequence numbers are unique and monotonically increasing (but not necessarily contiguous) for a specific timestamp across record types in the same partition. To guarantee ordered processing, the reader should process records (of potentially different types) in record_sequence order for a specific timestamp in the same partition.

string record_sequence = 2;

Returns
Type Description
String

The recordSequence.

getRecordSequenceBytes()

public ByteString getRecordSequenceBytes()

Record sequence numbers are unique and monotonically increasing (but not necessarily contiguous) for a specific timestamp across record types in the same partition. To guarantee ordered processing, the reader should process records (of potentially different types) in record_sequence order for a specific timestamp in the same partition.

string record_sequence = 2;

Returns
Type Description
ByteString

The bytes for recordSequence.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasCommitTimestamp()

public boolean hasCommitTimestamp()

Indicates the commit timestamp at which the key range change occurred. DataChangeRecord.commit_timestamps, PartitionStartRecord.start_timestamps, PartitionEventRecord.commit_timestamps, and PartitionEndRecord.end_timestamps can have the same value in the same partition.

.google.protobuf.Timestamp commit_timestamp = 1;

Returns
Type Description
boolean

Whether the commitTimestamp field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public ChangeStreamRecord.PartitionEventRecord.Builder newBuilderForType()
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ChangeStreamRecord.PartitionEventRecord.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public ChangeStreamRecord.PartitionEventRecord.Builder toBuilder()
Returns
Type Description
ChangeStreamRecord.PartitionEventRecord.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException