org.apache.cassandra.db

## Class CounterMutation

- java.lang.Object
- - org.apache.cassandra.db.CounterMutation

All Implemented Interfaces:
  IMutation

    public class CounterMutation
    extends java.lang.Object
    implements IMutation

### Nested Class Summary

Nested Classes
`static class` `CounterMutation.CounterMutationSerializer`

### Field Summary

Fields
`static CounterMutation.CounterMutationSerializer` `serializer`

### Constructor Summary

Constructors
Constructor and Description
`CounterMutation(Mutation mutation, ConsistencyLevel consistency)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addAll(IMutation m)`
`Mutation` `apply()` Applies the counter mutation, returns the result Mutation (for replication to other nodes).
`ConsistencyLevel` `consistency()`
`java.util.Collection<ColumnFamily>` `getColumnFamilies()`
`java.util.Collection<java.util.UUID>` `getColumnFamilyIds()`
`java.lang.String` `getKeyspaceName()`
`Mutation` `getMutation()`
`long` `getTimeout()`
`java.nio.ByteBuffer` `key()`
`MessageOut<CounterMutation>` `makeMutationMessage()`
`java.lang.String` `toString()`
`java.lang.String` `toString(boolean shallow)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### 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:
  `getKeyspaceName` in interface `IMutation`

#### getColumnFamilyIds

    public java.util.Collection<java.util.UUID> getColumnFamilyIds()

Specified by:
  `getColumnFamilyIds` in interface `IMutation`

#### getColumnFamilies

    public java.util.Collection<ColumnFamily> getColumnFamilies()

Specified by:
  `getColumnFamilies` in interface `IMutation`

#### getMutation

    public Mutation getMutation()

#### key

    public java.nio.ByteBuffer key()

Specified by:
  `key` in interface `IMutation`

#### consistency

    public ConsistencyLevel consistency()

#### makeMutationMessage

    public MessageOut<CounterMutation> makeMutationMessage()

#### apply

    public Mutation apply()
                   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`

#### addAll

    public void addAll(IMutation m)

Specified by:
  `addAll` in interface `IMutation`

#### getTimeout

    public long getTimeout()

Specified by:
  `getTimeout` in interface `IMutation`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### toString

    public java.lang.String toString(boolean shallow)

Specified by:
  `toString` in interface `IMutation`