@DefaultCoder(value=AvroCoder.class) public class DataChangeRecord extends java.lang.Object implements ChangeStreamRecord
ModType
. There can be multiple data
change records for a transaction and commit timestamp.Constructor and Description |
---|
DataChangeRecord(java.lang.String partitionToken,
com.google.cloud.Timestamp commitTimestamp,
java.lang.String serverTransactionId,
boolean isLastRecordInTransactionInPartition,
java.lang.String recordSequence,
java.lang.String tableName,
java.util.List<ColumnType> rowType,
java.util.List<Mod> mods,
ModType modType,
ValueCaptureType valueCaptureType,
long numberOfRecordsInTransaction,
long numberOfPartitionsInTransaction,
java.lang.String transactionTag,
boolean isSystemTransaction,
ChangeStreamRecordMetadata metadata)
Constructs a data change record for a given partition, at a given timestamp, for a given
transaction.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
com.google.cloud.Timestamp |
getCommitTimestamp()
The timestamp at which the modifications within were committed in Cloud Spanner.
|
ChangeStreamRecordMetadata |
getMetadata()
The connector execution metadata for this record.
|
java.util.List<Mod> |
getMods()
The modifications within this record.
|
ModType |
getModType()
The type of operation that caused the modifications within this record.
|
long |
getNumberOfPartitionsInTransaction()
The total number of partitions for the given transaction.
|
long |
getNumberOfRecordsInTransaction()
The total number of data change records for the given transaction.
|
java.lang.String |
getPartitionToken()
The unique identifier of the partition that generated this record.
|
java.lang.String |
getRecordSequence()
Indicates the order in which this record was put into the change stream in the scope of a
partition, commit timestamp and transaction tuple.
|
com.google.cloud.Timestamp |
getRecordTimestamp()
The timestamp at which the modifications within were committed in Cloud Spanner.
|
java.util.List<ColumnType> |
getRowType()
The type of the primary keys and modified columns within this record.
|
java.lang.String |
getServerTransactionId()
The unique transaction id in which the modifications occurred.
|
java.lang.String |
getTableName()
The name of the table in which the modifications within this record occurred.
|
java.lang.String |
getTransactionTag()
The transaction tag associated with the given transaction.
|
ValueCaptureType |
getValueCaptureType()
The capture type of the change stream that generated this record.
|
int |
hashCode() |
boolean |
isLastRecordInTransactionInPartition()
Indicates whether this record is the last emitted for the given transaction in the given
partition.
|
boolean |
isSystemTransaction()
Whether the given transaction is Spanner system transaction.
|
java.lang.String |
toString() |
public DataChangeRecord(java.lang.String partitionToken, com.google.cloud.Timestamp commitTimestamp, java.lang.String serverTransactionId, boolean isLastRecordInTransactionInPartition, java.lang.String recordSequence, java.lang.String tableName, java.util.List<ColumnType> rowType, java.util.List<Mod> mods, ModType modType, ValueCaptureType valueCaptureType, long numberOfRecordsInTransaction, long numberOfPartitionsInTransaction, java.lang.String transactionTag, boolean isSystemTransaction, ChangeStreamRecordMetadata metadata)
partitionToken
- the unique identifier of the partition that generated this recordcommitTimestamp
- the timestamp at which the modifications within were committed in Cloud
SpannerserverTransactionId
- the unique transaction id in which the modifications occurredisLastRecordInTransactionInPartition
- indicates whether this record is the last emitted
for the given transaction in the given partitionrecordSequence
- indicates the order in which this record was put into the change stream
in the scope of a partition, commit timestamp and transaction tupletableName
- the name of the table in which the modifications occurredrowType
- the type of the primary keys and modified columnsmods
- the modifications occurredmodType
- the operation that caused the modification to occurvalueCaptureType
- the capture type of the change streamnumberOfRecordsInTransaction
- the total number of records for the given transactionnumberOfPartitionsInTransaction
- the total number of partitions within the given
transactiontransactionTag
- the transaction tag associated with the given transactionisSystemTransaction
- whether the given transaction is Spanner system transaction (or user
transaction)metadata
- connector execution metadata for the given recordpublic com.google.cloud.Timestamp getRecordTimestamp()
getRecordTimestamp
in interface ChangeStreamRecord
public java.lang.String getPartitionToken()
public com.google.cloud.Timestamp getCommitTimestamp()
public java.lang.String getServerTransactionId()
public boolean isLastRecordInTransactionInPartition()
public java.lang.String getRecordSequence()
public java.lang.String getTableName()
public java.util.List<ColumnType> getRowType()
public java.util.List<Mod> getMods()
public ModType getModType()
public ValueCaptureType getValueCaptureType()
public long getNumberOfRecordsInTransaction()
public long getNumberOfPartitionsInTransaction()
public java.lang.String getTransactionTag()
public boolean isSystemTransaction()
public ChangeStreamRecordMetadata getMetadata()
public boolean equals(@Nullable java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object