public static class PartitionMetadataDao.InTransactionContext
extends java.lang.Object
Constructor and Description |
---|
InTransactionContext(java.lang.String metadataTableName,
com.google.cloud.spanner.TransactionContext transaction)
Constructs a context to execute a user defined function transactionally.
|
Modifier and Type | Method and Description |
---|---|
com.google.cloud.spanner.Struct |
getPartition(java.lang.String partitionToken)
Fetches the partition metadata row data for the given partition token.
|
java.lang.Void |
insert(PartitionMetadata row)
Inserts the partition metadata.
|
java.lang.Void |
updateToFinished(java.lang.String partitionToken)
Updates a partition row to
PartitionMetadata.State.FINISHED state. |
java.lang.Void |
updateToRunning(java.lang.String partitionToken)
Updates a partition row to
PartitionMetadata.State.RUNNING state. |
java.lang.Void |
updateToScheduled(java.lang.String partitionToken)
Updates a partition row to
PartitionMetadata.State.SCHEDULED state. |
java.lang.Void |
updateWatermark(java.lang.String partitionToken,
com.google.cloud.Timestamp watermark)
Update the partition watermark to the given timestamp.
|
public InTransactionContext(java.lang.String metadataTableName, com.google.cloud.spanner.TransactionContext transaction)
metadataTableName
- the name of the partition metadata tabletransaction
- the underlying client library transaction to be executedpublic java.lang.Void insert(PartitionMetadata row)
row
- the partition metadata to be insertedpublic java.lang.Void updateToScheduled(java.lang.String partitionToken)
PartitionMetadata.State.SCHEDULED
state.partitionToken
- the partition unique identifierpublic java.lang.Void updateToRunning(java.lang.String partitionToken)
PartitionMetadata.State.RUNNING
state.partitionToken
- the partition unique identifierpublic java.lang.Void updateToFinished(java.lang.String partitionToken)
PartitionMetadata.State.FINISHED
state.partitionToken
- the partition unique identifierpublic java.lang.Void updateWatermark(java.lang.String partitionToken, com.google.cloud.Timestamp watermark)
partitionToken
- the partition unique identifierwatermark
- the new partition watermark@Nullable public com.google.cloud.spanner.Struct getPartition(java.lang.String partitionToken)
partitionToken
- the partition unique identifier