#[non_exhaustive]pub struct PartitionEventRecord {
pub commit_timestamp: Option<Timestamp>,
pub record_sequence: String,
pub partition_token: String,
pub move_in_events: Vec<MoveInEvent>,
pub move_out_events: Vec<MoveOutEvent>,
/* private fields */
}Expand description
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.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.commit_timestamp: Option<Timestamp>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.
record_sequence: StringRecord 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.
partition_token: StringUnique 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.
move_in_events: Vec<MoveInEvent>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” } }
move_out_events: Vec<MoveOutEvent>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” } }
Implementations§
Source§impl PartitionEventRecord
impl PartitionEventRecord
Sourcepub fn set_commit_timestamp<T>(self, v: T) -> Self
pub fn set_commit_timestamp<T>(self, v: T) -> Self
Sets the value of commit_timestamp.
Sourcepub fn set_or_clear_commit_timestamp<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_commit_timestamp<T>(self, v: Option<T>) -> Self
Sets or clears the value of commit_timestamp.
Sourcepub fn set_record_sequence<T: Into<String>>(self, v: T) -> Self
pub fn set_record_sequence<T: Into<String>>(self, v: T) -> Self
Sets the value of record_sequence.
Sourcepub fn set_partition_token<T: Into<String>>(self, v: T) -> Self
pub fn set_partition_token<T: Into<String>>(self, v: T) -> Self
Sets the value of partition_token.
Sourcepub fn set_move_in_events<T, V>(self, v: T) -> Self
pub fn set_move_in_events<T, V>(self, v: T) -> Self
Sets the value of move_in_events.
Sourcepub fn set_move_out_events<T, V>(self, v: T) -> Self
pub fn set_move_out_events<T, V>(self, v: T) -> Self
Sets the value of move_out_events.
Trait Implementations§
Source§impl Clone for PartitionEventRecord
impl Clone for PartitionEventRecord
Source§fn clone(&self) -> PartitionEventRecord
fn clone(&self) -> PartitionEventRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PartitionEventRecord
impl Debug for PartitionEventRecord
Source§impl Default for PartitionEventRecord
impl Default for PartitionEventRecord
Source§fn default() -> PartitionEventRecord
fn default() -> PartitionEventRecord
Source§impl Message for PartitionEventRecord
impl Message for PartitionEventRecord
Source§impl PartialEq for PartitionEventRecord
impl PartialEq for PartitionEventRecord
Source§fn eq(&self, other: &PartitionEventRecord) -> bool
fn eq(&self, other: &PartitionEventRecord) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PartitionEventRecord
Auto Trait Implementations§
impl Freeze for PartitionEventRecord
impl RefUnwindSafe for PartitionEventRecord
impl Send for PartitionEventRecord
impl Sync for PartitionEventRecord
impl Unpin for PartitionEventRecord
impl UnsafeUnpin for PartitionEventRecord
impl UnwindSafe for PartitionEventRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request