Package org.apache.cassandra.db
Class CounterMutation
- java.lang.Object
-
- org.apache.cassandra.db.CounterMutation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCounterMutation.CounterMutationSerializer
-
Field Summary
Fields Modifier and Type Field Description static CounterMutation.CounterMutationSerializerserializer-
Fields inherited from interface org.apache.cassandra.db.IMutation
MAX_MUTATION_SIZE
-
-
Constructor Summary
Constructors Constructor Description CounterMutation(Mutation mutation, ConsistencyLevel consistency)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply()MutationapplyCounterMutation()Applies the counter mutation, returns the result Mutation (for replication to other nodes).ConsistencyLevelconsistency()java.lang.StringgetKeyspaceName()MutationgetMutation()java.util.Collection<PartitionUpdate>getPartitionUpdates()java.util.Collection<TableId>getTableIds()longgetTimeout(java.util.concurrent.TimeUnit unit)java.util.function.Supplier<Mutation>hintOnFailure()DecoratedKeykey()intserializedSize(int version)java.lang.StringtoString()java.lang.StringtoString(boolean shallow)voidvalidateSize(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, wait
-
Methods inherited from interface org.apache.cassandra.db.IMutation
validateIndexedColumns
-
-
-
-
Field Detail
-
serializer
public static final CounterMutation.CounterMutationSerializer serializer
-
-
Constructor Detail
-
CounterMutation
public CounterMutation(Mutation mutation, ConsistencyLevel consistency)
-
-
Method Detail
-
getKeyspaceName
public java.lang.String getKeyspaceName()
- Specified by:
getKeyspaceNamein interfaceIMutation
-
getTableIds
public java.util.Collection<TableId> getTableIds()
- Specified by:
getTableIdsin interfaceIMutation
-
getPartitionUpdates
public java.util.Collection<PartitionUpdate> getPartitionUpdates()
- Specified by:
getPartitionUpdatesin interfaceIMutation
-
hintOnFailure
public java.util.function.Supplier<Mutation> hintOnFailure()
- Specified by:
hintOnFailurein interfaceIMutation
-
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.
-
getMutation
public Mutation getMutation()
-
key
public DecoratedKey key()
-
consistency
public ConsistencyLevel consistency()
-
applyCounterMutation
public Mutation applyCounterMutation() throws WriteTimeoutException
Applies the counter mutation, returns the result Mutation (for replication to other nodes). 1. Grabs the striped cell-level locks in the proper order 2. Gets the current values of the counters-to-be-modified from the counter cache 3. Reads the rest of the current values (cache misses) from the CF 4. Writes the updated counter values 5. Updates the counter cache 6. Releases the lock(s) See CASSANDRA-4775 and CASSANDRA-6504 for further details.- Returns:
- the applied resulting Mutation
- Throws:
WriteTimeoutException
-
getTimeout
public long getTimeout(java.util.concurrent.TimeUnit unit)
- Specified by:
getTimeoutin interfaceIMutation
-
serializedSize
public int serializedSize(int version)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-