Class ChangeStreamMutation (2.32.0)

public abstract class ChangeStreamMutation 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();
 

Inheritance

java.lang.Object > ChangeStreamMutation

Constructors

ChangeStreamMutation()

public ChangeStreamMutation()

Methods

getCommitTimestamp()

public abstract Instant getCommitTimestamp()

Get the commit timestamp of the current mutation.

Returns
TypeDescription
org.threeten.bp.Instant

getEntries()

public abstract ImmutableList<Entry> getEntries()

Get the list of mods of the current mutation.

Returns
TypeDescription
com.google.common.collect.ImmutableList<Entry>

getEstimatedLowWatermark()

public abstract Instant getEstimatedLowWatermark()

Get the low watermark of the current mutation.

Returns
TypeDescription
org.threeten.bp.Instant

getRowKey()

public abstract ByteString getRowKey()

Get the row key of the current mutation.

Returns
TypeDescription
ByteString

getSourceClusterId()

public abstract String getSourceClusterId()

Get the source cluster id of the current mutation.

Returns
TypeDescription
String

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.

Returns
TypeDescription
int

getToken()

public abstract String getToken()

Get the token of the current mutation, which can be used to resume the changestream.

Returns
TypeDescription
String

getType()

public abstract ChangeStreamMutation.MutationType getType()

Get the type of the current mutation.

Returns
TypeDescription
ChangeStreamMutation.MutationType

toRowMutation(String tableId)

public RowMutation toRowMutation(String tableId)
Parameter
NameDescription
tableIdString
Returns
TypeDescription
RowMutation

toRowMutationEntry()

public RowMutationEntry toRowMutationEntry()
Returns
TypeDescription
RowMutationEntry