Package org.apache.cassandra.db
Class Mutation
java.lang.Object
org.apache.cassandra.db.Mutation
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classCollects finalized partition updatesstatic interfaceInterface for building mutations geared towards human. -
Field Summary
FieldsFields inherited from interface org.apache.cassandra.db.IMutation
MAX_MUTATION_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionMutation(String keyspaceName, DecoratedKey key, com.google.common.collect.ImmutableMap<TableId, PartitionUpdate> modifications, long approxCreatedAtNanos) Mutation(String keyspaceName, DecoratedKey key, com.google.common.collect.ImmutableMap<TableId, PartitionUpdate> modifications, long approxCreatedAtNanos, boolean cdcEnabled) Mutation(PartitionUpdate update) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply()voidapply(boolean durableWrites) voidapply(boolean durableWrites, boolean isDroppable) Future<?>voidget()longgetPartitionUpdate(TableMetadata table) com.google.common.collect.ImmutableCollection<PartitionUpdate>longgetTimeout(TimeUnit unit) booleanisEmpty()key()static MutationCreates a new mutation that merges all the provided mutations.intserializedSize(int version) static Mutation.SimpleBuildersimpleBuilder(String keyspaceName, DecoratedKey partitionKey) Creates a new simple mutuation builder.inttoString()toString(boolean shallow) booleanvoidvalidateSize(int version, int overhead) Validates size of mutation does not exceedDatabaseDescriptor.getMaxMutationSize().Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cassandra.db.IMutation
validateIndexedColumns
-
Field Details
-
serializer
-
-
Constructor Details
-
Mutation
-
Mutation
public Mutation(String keyspaceName, DecoratedKey key, com.google.common.collect.ImmutableMap<TableId, PartitionUpdate> modifications, long approxCreatedAtNanos) -
Mutation
public Mutation(String keyspaceName, DecoratedKey key, com.google.common.collect.ImmutableMap<TableId, PartitionUpdate> modifications, long approxCreatedAtNanos, boolean cdcEnabled)
-
-
Method Details
-
without
-
without
-
getKeyspaceName
- Specified by:
getKeyspaceNamein interfaceIMutation
-
getTableIds
- Specified by:
getTableIdsin interfaceIMutation
-
key
-
getPartitionUpdates
- Specified by:
getPartitionUpdatesin interfaceIMutation
-
getApproxCreatedAtNanos
public long getApproxCreatedAtNanos() -
hintOnFailure
- Specified by:
hintOnFailurein interfaceIMutation
-
get
-
validateSize
public void validateSize(int version, int overhead) Description copied from interface:IMutationValidates size of mutation does not exceedDatabaseDescriptor.getMaxMutationSize().- Specified by:
validateSizein interfaceIMutation- Parameters:
version- the MessagingService version the mutation is being serialized for. seeMessagingService.current_versionoverhead- overhadd to add for mutation size to validate. Pass zero if not required but not a negative value.
-
getPartitionUpdate
-
isEmpty
public boolean isEmpty() -
merge
Creates a new mutation that merges all the provided mutations.- Parameters:
mutations- the mutations to merge together. All mutation must be on the same keyspace and partition key. There should also be at least one mutation.- Returns:
- a mutation that contains all the modifications contained in
mutations. - Throws:
IllegalArgumentException- if not all the mutations are on the same keyspace and key.
-
applyFuture
-
apply
public void apply(boolean durableWrites, boolean isDroppable) -
apply
public void apply(boolean durableWrites) -
apply
public void apply() -
applyUnsafe
public void applyUnsafe() -
getTimeout
- Specified by:
getTimeoutin interfaceIMutation
-
smallestGCGS
public int smallestGCGS() -
trackedByCDC
public boolean trackedByCDC() -
toString
-
toString
-
serializedSize
public int serializedSize(int version) -
simpleBuilder
Creates a new simple mutuation builder.- Parameters:
keyspaceName- the name of the keyspace this is a mutation for.partitionKey- the key of partition this if a mutation for.- Returns:
- a newly created builder.
-