# Class ChangeStreamMutation (2.79.0)

2.79.0 (latest) 2.78.1 2.77.0 2.74.0 2.73.0 2.72.0 2.71.0 2.70.0 2.68.0 2.67.1 2.66.0 2.65.1 2.63.0 2.62.0 2.61.0 2.60.0 2.59.0 2.58.2 2.56.0 2.54.0 2.52.0 2.51.2 2.49.0 2.46.0 2.45.1 2.44.1 2.43.0 2.42.0 2.40.0 2.39.5 2.37.0 2.35.1 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.1 2.28.0

    public abstract class ChangeStreamMutation implements ChangeStreamRecord, Serializable

A ChangeStreamMutation represents a list of mods(represented by List\<[Entry](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.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](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.RowMutation) or
[RowMutationEntry](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.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](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> ChangeStreamMutation

## Implements

[ChangeStreamRecord](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html)

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Constructors

### ChangeStreamMutation()

    public ChangeStreamMutation()

## Methods

### getCommitTime()

    public abstract Instant getCommitTime()

Get the commit timestamp of the current mutation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html` |   |

### getCommitTimestamp()

    public Instant getCommitTimestamp()

> [!WARNING]
> **Obsolete**
>
> *Use getCommitTime() instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#getCommitTime()](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation#com_google_cloud_bigtable_data_v2_models_ChangeStreamMutation_getCommitTime__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `org.threeten.bp.Instant` |   |

### getEntries()

    public abstract ImmutableList<Entry> getEntries()

Get the list of mods of the current mutation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.common.collect.ImmutableList<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.Entry>` |   |

### getEstimatedLowWatermark()

    public Instant getEstimatedLowWatermark()

> [!WARNING]
> **Obsolete**
>
> *Use getEstimatedLowWatermarkTime() instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#getEstimatedLowWatermarkTime()](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation#com_google_cloud_bigtable_data_v2_models_ChangeStreamMutation_getEstimatedLowWatermarkTime__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `org.threeten.bp.Instant` |   |

### getEstimatedLowWatermarkTime()

    public abstract Instant getEstimatedLowWatermarkTime()

Get the low watermark of the current mutation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html` |   |

### getRowKey()

    public abstract ByteString getRowKey()

Get the row key of the current mutation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` |   |

### getSourceClusterId()

    public abstract String getSourceClusterId()

Get the source cluster id of the current mutation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### 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** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getToken()

    public abstract String getToken()

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getType()

    public abstract ChangeStreamMutation.MutationType getType()

Get the type of the current mutation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation.MutationType` |   |

### toRowMutation(String tableId)

    public RowMutation toRowMutation(String tableId)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tableId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.RowMutation` |   |

### toRowMutationEntry()

    public RowMutationEntry toRowMutationEntry()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.RowMutationEntry` |   |