Class BulkMutation (2.51.0)

public final class BulkMutation implements Serializable, Cloneable

Represents a list of mutations for multiple rows. Each mutation contains multiple changes that will be atomically applied to each row. However, ordering between rows is not guaranteed.

This class is meant for manual batching.

Inheritance

java.lang.Object > BulkMutation

Implements

Serializable, Cloneable

Static Methods

create(TargetId targetId)

public static BulkMutation create(TargetId targetId)

Creates a new instance of the bulk mutation builder for the given target with targetId. See Also: TableId, AuthorizedViewId

Parameter
Name Description
targetId TargetId
Returns
Type Description
BulkMutation

create(String tableId) (deprecated)

public static BulkMutation create(String tableId)

Deprecated. Please use BulkMutation#create(TargetId) instead.

Parameter
Name Description
tableId String
Returns
Type Description
BulkMutation

fromProto(MutateRowsRequest request)

public static BulkMutation fromProto(MutateRowsRequest request)

Wraps the protobuf MutateRowsRequest.

This is meant for advanced usage only. Please ensure that the MutateRowsRequest does not use server side timestamps. The BigtableDataClient assumes that mutation present in BulkMutation are idempotent and is configured to enable retries by default. If serverside timestamps are enabled then that 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.

Parameter
Name Description
request com.google.bigtable.v2.MutateRowsRequest
Returns
Type Description
BulkMutation

Methods

add(RowMutationEntry entry)

public BulkMutation add(RowMutationEntry entry)

Add mutation for a particular row. The changes in the mutation will be applied atomic. However there is no guarantees about the relative ordering between mutations affecting different rows.

Parameter
Name Description
entry RowMutationEntry
Returns
Type Description
BulkMutation

add(ByteString rowKey, Mutation mutation)

public BulkMutation add(ByteString rowKey, Mutation mutation)

Add mutation for a particular row. The changes in the mutation will be applied atomic. However there is no guarantees about the relative ordering between mutations affecting different rows.

Parameters
Name Description
rowKey ByteString
mutation Mutation
Returns
Type Description
BulkMutation

add(String rowKey, Mutation mutation)

public BulkMutation add(String rowKey, Mutation mutation)

Add mutation for a particular row. The changes in the mutation will be applied atomically. However there is no guarantees about the relative ordering between mutations affecting different rows.

Parameters
Name Description
rowKey String
mutation Mutation
Returns
Type Description
BulkMutation

clone()

public BulkMutation clone()

Creates a copy of BulkMutation.

Returns
Type Description
BulkMutation
Overrides

getEntryCount()

public int getEntryCount()
Returns
Type Description
int

toProto(RequestContext requestContext)

public MutateRowsRequest toProto(RequestContext requestContext)
Parameter
Name Description
requestContext com.google.cloud.bigtable.data.v2.internal.RequestContext
Returns
Type Description
com.google.bigtable.v2.MutateRowsRequest