public final class RowMutation implements MutationApi<RowMutation>, Serializable
Represents a list of mutations targeted at a single row. It's meant to be used as an parameter for com.google.cloud.bigtable.data.v2.BigtableDataClient#mutateRowAsync(RowMutation).
Implements
com.google.cloud.bigtable.data.v2.models.MutationApi<com.google.cloud.bigtable.data.v2.models.RowMutation>, SerializableStatic Methods
create(String tableId, ByteString key)
public static RowMutation create(String tableId, ByteString key)
Creates a new instance of the mutation builder.
Name | Description |
tableId | String |
key | ByteString |
Type | Description |
RowMutation |
create(String tableId, ByteString key, Mutation mutation)
public static RowMutation create(String tableId, ByteString key, Mutation mutation)
Creates new instance of mutation builder by wrapping existing set of row mutations. The builder will be owned by this RowMutation and should not be used by the caller after this call. This functionality is intended for advanced usage.
Sample code:
Mutation mutation = Mutation.create()
.setCell("[FAMILY_NAME]", "[QUALIFIER]", [TIMESTAMP], "[VALUE]");
RowMutation rowMutation = RowMutation.create("[TABLE]", [BYTE_STRING_ROW_KEY], mutation);
Name | Description |
tableId | String |
key | ByteString |
mutation | Mutation |
Type | Description |
RowMutation |
create(String tableId, String key)
public static RowMutation create(String tableId, String key)
Creates a new instance of the mutation builder.
Name | Description |
tableId | String |
key | String |
Type | Description |
RowMutation |
create(String tableId, String key, Mutation mutation)
public static RowMutation create(String tableId, String key, Mutation mutation)
Creates new instance of mutation builder by wrapping existing set of row mutations. The builder will be owned by this RowMutation and should not be used by the caller after this call. This functionality is intended for advanced usage.
Sample code:
Mutation mutation = Mutation.create()
.setCell("[FAMILY_NAME]", "[QUALIFIER]", [TIMESTAMP], "[VALUE]");
RowMutation rowMutation = RowMutation.create("[TABLE]", "[ROW_KEY]", mutation);
Name | Description |
tableId | String |
key | String |
mutation | Mutation |
Type | Description |
RowMutation |
fromProto(MutateRowRequest request)
public static RowMutation fromProto(MutateRowRequest request)
Wraps the protobuf MutateRowRequest.
This is meant for advanced usage only. Please ensure that the MutateRowRequest does not use server side timestamps. The BigtableDataClient assumes that RowMutations are idempotent and is configured to enable retries by default. If serverside timestamps are enabled, this can lead to duplicate mutations.
WARNING: when applied, the resulting mutation object will ignore the project id and instance id in the table_name and instead apply the configuration in the client.
Name | Description |
request | MutateRowRequest |
Type | Description |
RowMutation |
Methods
deleteCells(String familyName, ByteString qualifier)
public RowMutation deleteCells(String familyName, ByteString qualifier)
Adds a mutation which deletes cells from the specified column.
Name | Description |
familyName | String |
qualifier | ByteString |
Type | Description |
RowMutation |
deleteCells(String familyName, ByteString qualifier, Range.TimestampRange timestampRange)
public RowMutation deleteCells(String familyName, ByteString qualifier, Range.TimestampRange timestampRange)
Adds a mutation which deletes cells from the specified column, restricted to a given timestamp range.
Name | Description |
familyName | String |
qualifier | ByteString |
timestampRange | Range.TimestampRange |
Type | Description |
RowMutation |
deleteCells(String familyName, String qualifier)
public RowMutation deleteCells(String familyName, String qualifier)
Adds a mutation which deletes cells from the specified column.
Name | Description |
familyName | String |
qualifier | String |
Type | Description |
RowMutation |
deleteFamily(String familyName)
public RowMutation deleteFamily(String familyName)
Adds a mutation which deletes all cells from the specified column family.
Name | Description |
familyName | String |
Type | Description |
RowMutation |
deleteRow()
public RowMutation deleteRow()
Adds a mutation which deletes all cells from the containing row.
Type | Description |
RowMutation |
setCell(String familyName, ByteString qualifier, ByteString value)
public RowMutation setCell(String familyName, ByteString qualifier, ByteString value)
Adds a mutation which sets the value of the specified cell.
Uses microseconds since epoch as the timestamp.
Name | Description |
familyName | String |
qualifier | ByteString |
value | ByteString |
Type | Description |
RowMutation |
setCell(String familyName, ByteString qualifier, long value)
public RowMutation setCell(String familyName, ByteString qualifier, long value)
Adds a mutation which sets the value of the specified cell.
Uses microseconds since epoch as the timestamp.
Name | Description |
familyName | String |
qualifier | ByteString |
value | long |
Type | Description |
RowMutation |
setCell(String familyName, ByteString qualifier, long timestamp, ByteString value)
public RowMutation setCell(String familyName, ByteString qualifier, long timestamp, ByteString value)
Adds a mutation which sets the value of the specified cell.
Note: The timestamp values are in microseconds but must match the granularity of the
table(defaults to MILLIS
). Therefore, the given value must be a multiple of 1000 (millisecond
granularity). For example: 1571902339435000
.
Name | Description |
familyName | String |
qualifier | ByteString |
timestamp | long |
value | ByteString |
Type | Description |
RowMutation |
setCell(String familyName, ByteString qualifier, long timestamp, long value)
public RowMutation setCell(String familyName, ByteString qualifier, long timestamp, long value)
Adds a mutation which sets the value of the specified cell.
Note: The timestamp values are in microseconds but must match the granularity of the
table(defaults to MILLIS
). Therefore, the given value must be a multiple of 1000 (millisecond
granularity). For example: 1571902339435000
.
Name | Description |
familyName | String |
qualifier | ByteString |
timestamp | long |
value | long |
Type | Description |
RowMutation |
setCell(String familyName, String qualifier, String value)
public RowMutation setCell(String familyName, String qualifier, String value)
Adds a mutation which sets the value of the specified cell.
This a convenience method that converts Strings to ByteStrings and uses microseconds since epoch as the timestamp.
Name | Description |
familyName | String |
qualifier | String |
value | String |
Type | Description |
RowMutation |
setCell(String familyName, String qualifier, long value)
public RowMutation setCell(String familyName, String qualifier, long value)
Adds a mutation which sets the value of the specified cell.
This a convenience method that converts Strings to ByteStrings and uses microseconds since epoch as the timestamp. Also it accepts long value.
Name | Description |
familyName | String |
qualifier | String |
value | long |
Type | Description |
RowMutation |
setCell(String familyName, String qualifier, long timestamp, String value)
public RowMutation setCell(String familyName, String qualifier, long timestamp, String value)
Adds a mutation which sets the value of the specified cell.
This is a convenience override that converts Strings to ByteStrings.
Note: The timestamp values are in microseconds but must match the granularity of the
table(defaults to MILLIS
). Therefore, the given value must be a multiple of 1000 (millisecond
granularity). For example: 1571902339435000
.
Name | Description |
familyName | String |
qualifier | String |
timestamp | long |
value | String |
Type | Description |
RowMutation |
setCell(String familyName, String qualifier, long timestamp, long value)
public RowMutation setCell(String familyName, String qualifier, long timestamp, long value)
Adds a mutation which sets the value of the specified cell.
This is a convenience override that converts Strings to ByteStrings.
Note: The timestamp values are in microseconds but must match the granularity of the
table(defaults to MILLIS
). Therefore, the given value must be a multiple of 1000 (millisecond
granularity). For example: 1571902339435000
.
Name | Description |
familyName | String |
qualifier | String |
timestamp | long |
value | long |
Type | Description |
RowMutation |
toBulkProto(RequestContext requestContext)
public MutateRowsRequest toBulkProto(RequestContext requestContext)
Creates a single entry bulk com.google.bigtable.v2.MutateRowsRequest, which will be merged by the batching logic in the callable chain.
Name | Description |
requestContext | com.google.cloud.bigtable.data.v2.internal.RequestContext |
Type | Description |
MutateRowsRequest |
toProto(RequestContext requestContext)
public MutateRowRequest toProto(RequestContext requestContext)
Name | Description |
requestContext | com.google.cloud.bigtable.data.v2.internal.RequestContext |
Type | Description |
MutateRowRequest |