Package org.apache.cassandra.db
Class CounterMutation
java.lang.Object
org.apache.cassandra.db.CounterMutation
- All Implemented Interfaces:
IMutation
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface org.apache.cassandra.db.IMutation
MAX_MUTATION_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply()Applies the counter mutation, returns the result Mutation (for replication to other nodes).longgetTimeout(TimeUnit unit) key()intserializedSize(int version) toString()toString(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, waitMethods inherited from interface org.apache.cassandra.db.IMutation
validateIndexedColumns
-
Field Details
-
serializer
-
-
Constructor Details
-
CounterMutation
-
-
Method Details
-
getKeyspaceName
- Specified by:
getKeyspaceNamein interfaceIMutation
-
getTableIds
- Specified by:
getTableIdsin interfaceIMutation
-
getPartitionUpdates
- Specified by:
getPartitionUpdatesin interfaceIMutation
-
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
-
key
-
consistency
-
applyCounterMutation
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
-
apply
public void apply() -
getTimeout
- Specified by:
getTimeoutin interfaceIMutation
-
serializedSize
public int serializedSize(int version) -
toString
-
toString
-