@InternalApi(value="Intended for use by the BigtableIO in apache/beam only.") public abstract class ChangeStreamMutation extends Object implements ChangeStreamRecord, Serializable
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
ChangeStreamMutation.MutationType |
| Constructor and Description |
|---|
ChangeStreamMutation() |
| Modifier and Type | Method and Description |
|---|---|
abstract long |
getCommitTimestamp()
Get the commit timestamp of the current mutation.
|
abstract com.google.common.collect.ImmutableList<Entry> |
getEntries()
Get the list of mods of the current mutation.
|
abstract long |
getEstimatedLowWatermark()
Get the low watermark of the current mutation.
|
abstract com.google.protobuf.ByteString |
getRowKey()
Get the row key of the current mutation.
|
abstract String |
getSourceClusterId()
Get the source cluster id of the current mutation.
|
abstract int |
getTieBreaker()
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.
|
RowMutation |
toRowMutation(String tableId) |
RowMutationEntry |
toRowMutationEntry() |
@Nonnull public abstract com.google.protobuf.ByteString getRowKey()
@Nonnull public abstract ChangeStreamMutation.MutationType getType()
@Nonnull public abstract String getSourceClusterId()
public abstract long getCommitTimestamp()
public abstract int getTieBreaker()
@Nonnull public abstract String getToken()
public abstract long getEstimatedLowWatermark()
@Nonnull public abstract com.google.common.collect.ImmutableList<Entry> getEntries()
public RowMutation toRowMutation(@Nonnull String tableId)
public RowMutationEntry toRowMutationEntry()
Copyright © 2023 Google LLC. All rights reserved.