Class ChangeStreamMutation
java.lang.Object
com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation
- All Implemented Interfaces:
ChangeStreamRecord
,Serializable
@InternalApi("Intended for use by the BigtableIO in apache/beam only.")
public abstract class ChangeStreamMutation
extends Object
implements ChangeStreamRecord, Serializable
A ChangeStreamMutation represents a list of mods(represented by List<
Entry
>) targeted at
a single row, which is concatenated by ChangeStreamRecordMerger
. It represents a logical
row mutation and can be converted to the original write request(i.e. RowMutation
or
RowMutationEntry
.
A ChangeStreamMutation can be constructed in two ways, depending on whether it's a user initiated mutation or a Garbage Collection mutation. Either way, the caller should explicitly set `token` and `estimatedLowWatermark` before build(), otherwise it'll raise an error.
Case 1) User initiated mutation.
ChangeStreamMutation.Builder builder = ChangeStreamMutation.createUserMutation(...);
builder.setCell(...);
builder.deleteFamily(...);
builder.deleteCells(...);
ChangeStreamMutation changeStreamMutation = builder.setToken(...).setEstimatedLowWatermark().build();
Case 2) Garbage Collection mutation.
ChangeStreamMutation.Builder builder = ChangeStreamMutation.createGcMutation(...);
builder.setCell(...);
builder.deleteFamily(...);
builder.deleteCells(...);
ChangeStreamMutation changeStreamMutation = builder.setToken(...).setEstimatedLowWatermark().build();
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract org.threeten.bp.Instant
Get the commit timestamp of the current mutation.abstract com.google.common.collect.ImmutableList<Entry>
Get the list of mods of the current mutation.abstract org.threeten.bp.Instant
Get the low watermark of the current mutation.abstract com.google.protobuf.ByteString
Get the row key of the current mutation.abstract String
Get the source cluster id of the current mutation.abstract int
Get the tie breaker of the current mutation.abstract String
getToken()
Get the token of the current mutation, which can be used to resume the changestream.abstract ChangeStreamMutation.MutationType
getType()
Get the type of the current mutation.toRowMutation
(String tableId)
-
Constructor Details
-
ChangeStreamMutation
public ChangeStreamMutation()
-
-
Method Details
-
getRowKey
Get the row key of the current mutation. -
getType
Get the type of the current mutation. -
getSourceClusterId
Get the source cluster id of the current mutation. -
getCommitTimestamp
public abstract org.threeten.bp.Instant getCommitTimestamp()Get the commit timestamp of the current mutation. -
getTieBreaker
public abstract int getTieBreaker()Get the tie breaker of the current mutation. This is used to resolve conflicts when multiple mutations are applied to different clusters at the same time. -
getToken
Get the token of the current mutation, which can be used to resume the changestream. -
getEstimatedLowWatermark
public abstract org.threeten.bp.Instant getEstimatedLowWatermark()Get the low watermark of the current mutation. -
getEntries
Get the list of mods of the current mutation. -
toRowMutation
-
toRowMutationEntry
-