public class ChangeStreamRecordMapper extends java.lang.Object
|Modifier and Type||Method and Description|
public java.util.List<ChangeStreamRecord> toChangeStreamRecords(PartitionMetadata partition, Struct row, ChangeStreamResultSetMetadata resultSetMetadata)
Structrepresenting a change stream result into a
ChangeStreamRecordmodel. The type of the change stream record will be identified and one of the following subclasses can be returned within the resulting
Structreceived, the originating partition of the records (given by the
PartitionMetadataparameter) and the stream metadata (given by the
ChangeStreamResultSetMetadata) are used to populate the
ChangeStreamRecordMetadatafor each record mapped.
Struct is expected to have the following fields:
Structlist of data change records.
Timestamprepresenting the timestamp at which the modifications within the record were committed in Cloud Spanner.
Stringrepresenting the unique transaction id in which the modifications for this record occurred.
Booleanindicating whether this record is the last emitted for the transaction.
Stringrepresenting the order in which this record appears within the context of a partition, commit timestamp and transaction.
Stringrepresenting the name of the table in which the modifications for this record occurred.
Structs representing the type of the primary keys and modified columns within this record.
Stringrepresenting the name of a column.
Stringrepresenting the type of a column.
Booleanindicating if the column is part of the primary key.
Longrepresenting the position of the column in the table it is defined.
Structs representing the data modifications within this record.
Stringjson object, where keys are the primary key column names, and the values are their corresponding values.
Stringjson object displaying the old state of the columns modified, where keys are the column names, and the values are their corresponding values.
Stringjson object displaying the new state of the columns modified, where keys are the column names, and the values are their corresponding values.
Stringrepresenting the type of operation that caused the modifications (see also
Stringrepresenting the capture type of the change stream that generated this record (see also
Longrepresenting the total number of data change records for the transaction in which this record occurred.
Longrepresenting the total number of partitions for the transaction in which this record occurred.
Structlist of hearbeat records.
Structlist of child partitions records.
Timestamprepresenting the timestamp at which the new partition started being valid in Cloud Spanner.
Stringrepresenting the order in which this record appears within the context of a partition and commit timestamp.
Structrepresenting the new child partitions.
partition- the partition metadata from which the row was generated
row- the struct row, representing a single change stream result (it may contain multiple change stream records within)
resultSetMetadata- the metadata generated when reading the change stream row