public final class Mutation extends Object implements MutationApi<Mutation>, Serializable
MutationApi
that can be used to create and represent a
list of mutations. It used by RowMutation
and ConditionalRowMutation
to
encapsulate a list of mutations that will to be applied to a single row.Modifier and Type | Method and Description |
---|---|
static Mutation |
create()
Creates new instance of Mutation object.
|
static Mutation |
createUnsafe()
Creates new instance of Mutation object which allows setCell operation to use server side
timestamp.
|
Mutation |
deleteCells(String familyName,
ByteString qualifier)
Adds a mutation which deletes cells from the specified column.
|
Mutation |
deleteCells(String familyName,
ByteString qualifier,
Range.TimestampRange timestampRange)
Adds a mutation which deletes cells from the specified column, restricted to a given timestamp
range.
|
Mutation |
deleteCells(String familyName,
String qualifier)
Adds a mutation which deletes cells from the specified column.
|
Mutation |
deleteFamily(String familyName)
Adds a mutation which deletes all cells from the specified column family.
|
Mutation |
deleteRow()
Adds a mutation which deletes all cells from the containing row.
|
static Mutation |
fromProtoUnsafe(List<Mutation> protos)
Wraps the List of protobuf
Mutation . |
Mutation |
setCell(String familyName,
ByteString qualifier,
ByteString value)
Adds a mutation which sets the value of the specified cell.
|
Mutation |
setCell(String familyName,
ByteString qualifier,
long value)
Adds a mutation which sets the value of the specified cell.
|
Mutation |
setCell(String familyName,
ByteString qualifier,
long timestamp,
ByteString value)
Adds a mutation which sets the value of the specified cell.
|
Mutation |
setCell(String familyName,
ByteString qualifier,
long timestamp,
long value)
Adds a mutation which sets the value of the specified cell.
|
Mutation |
setCell(String familyName,
String qualifier,
long value)
Adds a mutation which sets the value of the specified cell.
|
Mutation |
setCell(String familyName,
String qualifier,
long timestamp,
long value)
Adds a mutation which sets the value of the specified cell.
|
Mutation |
setCell(String familyName,
String qualifier,
long timestamp,
String value)
Adds a mutation which sets the value of the specified cell.
|
Mutation |
setCell(String familyName,
String qualifier,
String value)
Adds a mutation which sets the value of the specified cell.
|
public static Mutation create()
@BetaApi public static Mutation createUnsafe()
@BetaApi public static Mutation fromProtoUnsafe(List<Mutation> protos)
Mutation
. This methods, like createUnsafe()
, allows setCell operation to use server side timestamp. This is dangerous
because mutations will no longer be idempotent, which might cause multiple duplicate values to
be stored in Bigtable. This option should only be used for advanced usecases with extreme care.public Mutation setCell(@Nonnull String familyName, @Nonnull String qualifier, @Nonnull String value)
MutationApi
This a convenience method that converts Strings to ByteStrings and uses microseconds since epoch as the timestamp.
setCell
in interface MutationApi<Mutation>
public Mutation setCell(@Nonnull String familyName, @Nonnull String qualifier, long timestamp, @Nonnull String value)
MutationApi
This is a convenience override that converts Strings to ByteStrings.
setCell
in interface MutationApi<Mutation>
public Mutation setCell(@Nonnull String familyName, @Nonnull ByteString qualifier, @Nonnull ByteString value)
MutationApi
Uses microseconds since epoch as the timestamp.
setCell
in interface MutationApi<Mutation>
public Mutation setCell(@Nonnull String familyName, @Nonnull ByteString qualifier, long timestamp, @Nonnull ByteString value)
MutationApi
setCell
in interface MutationApi<Mutation>
public Mutation setCell(@Nonnull String familyName, @Nonnull String qualifier, long value)
MutationApi
This a convenience method that converts Strings to ByteStrings and uses microseconds since epoch as the timestamp. Also it accepts long value.
setCell
in interface MutationApi<Mutation>
public Mutation setCell(@Nonnull String familyName, @Nonnull String qualifier, long timestamp, long value)
MutationApi
This is a convenience override that converts Strings to ByteStrings.
setCell
in interface MutationApi<Mutation>
public Mutation setCell(@Nonnull String familyName, @Nonnull ByteString qualifier, long value)
MutationApi
Uses microseconds since epoch as the timestamp.
setCell
in interface MutationApi<Mutation>
public Mutation setCell(@Nonnull String familyName, @Nonnull ByteString qualifier, long timestamp, long value)
MutationApi
setCell
in interface MutationApi<Mutation>
public Mutation deleteCells(@Nonnull String familyName, @Nonnull String qualifier)
MutationApi
deleteCells
in interface MutationApi<Mutation>
public Mutation deleteCells(@Nonnull String familyName, @Nonnull ByteString qualifier)
MutationApi
deleteCells
in interface MutationApi<Mutation>
public Mutation deleteCells(@Nonnull String familyName, @Nonnull ByteString qualifier, @Nonnull Range.TimestampRange timestampRange)
MutationApi
deleteCells
in interface MutationApi<Mutation>
familyName
- The family name.qualifier
- The qualifier.timestampRange
- The timestamp range in microseconds.public Mutation deleteFamily(@Nonnull String familyName)
MutationApi
deleteFamily
in interface MutationApi<Mutation>
public Mutation deleteRow()
MutationApi
deleteRow
in interface MutationApi<Mutation>
Copyright © 2019 Google LLC. All rights reserved.