org.apache.cassandra.db

## Class Mutation

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

- All Implemented Interfaces:
    IMutation

      public class Mutation
      extends java.lang.Object
      implements IMutation

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Mutation.MutationSerializer`
    `static interface` | `Mutation.SimpleBuilder` Interface for building mutations geared towards human.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `long` | `createdAt`
    `static java.lang.String` | `FORWARD_FROM`
    `static java.lang.String` | `FORWARD_TO`
    `static Mutation.MutationSerializer` | `serializer`
    `java.util.concurrent.atomic.AtomicLong` | `viewLockAcquireStart`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `Mutation(PartitionUpdate update)`
    `` | `Mutation(java.lang.String keyspaceName, DecoratedKey key)`
    `protected` | `Mutation(java.lang.String keyspaceName, DecoratedKey key, java.util.Map<java.util.UUID,PartitionUpdate> modifications)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Mutation` | `add(PartitionUpdate update)` Adds PartitionUpdate to the local set of modifications.
    `void` | `apply()`
    `void` | `apply(boolean durableWrites)`
    `void` | `apply(boolean durableWrites, boolean isDroppable)`
    `java.util.concurrent.CompletableFuture<?>` | `applyFuture()`
    `void` | `applyUnsafe()`
    `Mutation` | `copy()`
    `MessageOut<Mutation>` | `createMessage()`
    `MessageOut<Mutation>` | `createMessage(MessagingService.Verb verb)`
    `PartitionUpdate` | `get(CFMetaData cfm)`
    `java.util.Collection<java.util.UUID>` | `getColumnFamilyIds()`
    `java.lang.String` | `getKeyspaceName()`
    `PartitionUpdate` | `getPartitionUpdate(java.util.UUID cfId)`
    `java.util.Collection<PartitionUpdate>` | `getPartitionUpdates()`
    `long` | `getTimeout()`
    `boolean` | `isEmpty()`
    `DecoratedKey` | `key()`
    `static Mutation` | `merge(java.util.List<Mutation> mutations)` Creates a new mutation that merges all the provided mutations.
    `static Mutation.SimpleBuilder` | `simpleBuilder(java.lang.String keyspaceName, DecoratedKey partitionKey)` Creates a new simple mutuation builder.
    `int` | `smallestGCGS()`
    `java.lang.String` | `toString()`
    `java.lang.String` | `toString(boolean shallow)`
    `boolean` | `trackedByCDC()`
    `Mutation` | `without(java.util.Set<java.util.UUID> cfIds)`
    `Mutation` | `without(java.util.UUID cfId)`

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

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

- - ### Field Detail

    - #### serializer

          public static final Mutation.MutationSerializer serializer

    - #### FORWARD_TO

          public static final java.lang.String FORWARD_TO

      See Also:
        Constant Field Values

    - #### FORWARD_FROM

          public static final java.lang.String FORWARD_FROM

      See Also:
        Constant Field Values

    - #### createdAt

          public final long createdAt

    - #### viewLockAcquireStart

          public final java.util.concurrent.atomic.AtomicLong viewLockAcquireStart

  - ### Constructor Detail

    - #### Mutation

          public Mutation(java.lang.String keyspaceName,
                          DecoratedKey key)

    - #### Mutation

          public Mutation(PartitionUpdate update)

    - #### Mutation

          protected Mutation(java.lang.String keyspaceName,
                             DecoratedKey key,
                             java.util.Map<java.util.UUID,PartitionUpdate> modifications)

  - ### Method Detail

    - #### copy

          public Mutation copy()

    - #### without

          public Mutation without(java.util.Set<java.util.UUID> cfIds)

    - #### without

          public Mutation without(java.util.UUID cfId)

    - #### 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`

    - #### key

          public DecoratedKey key()

      Specified by:
        `key` in interface `IMutation`

    - #### getPartitionUpdates

          public java.util.Collection<PartitionUpdate> getPartitionUpdates()

      Specified by:
        `getPartitionUpdates` in interface `IMutation`

    - #### getPartitionUpdate

          public PartitionUpdate getPartitionUpdate(java.util.UUID cfId)

    - #### add

          public Mutation add(PartitionUpdate update)

      Adds PartitionUpdate to the local set of modifications. Assumes no updates for the Table this PartitionUpdate impacts.
      Parameters:
        `update` - PartitionUpdate to append to Modifications list
      Returns:
        Mutation this mutation
      Throws:
        `java.lang.IllegalArgumentException` - If PartitionUpdate for duplicate table is passed as argument

    - #### get

          public PartitionUpdate get(CFMetaData cfm)

    - #### isEmpty

          public boolean isEmpty()

    - #### merge

          public static Mutation merge(java.util.List<Mutation> mutations)

      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:
        `java.lang.IllegalArgumentException` - if not all the mutations are on the same keyspace and key.

    - #### applyFuture

          public java.util.concurrent.CompletableFuture<?> applyFuture()

    - #### apply

          public void apply(boolean durableWrites,
                            boolean isDroppable)

    - #### apply

          public void apply(boolean durableWrites)

    - #### apply

          public void apply()

      Specified by:
        `apply` in interface `IMutation`

    - #### applyUnsafe

          public void applyUnsafe()

    - #### createMessage

          public MessageOut<Mutation> createMessage()

    - #### createMessage

          public MessageOut<Mutation> createMessage(MessagingService.Verb verb)

    - #### getTimeout

          public long getTimeout()

      Specified by:
        `getTimeout` in interface `IMutation`

    - #### smallestGCGS

          public int smallestGCGS()

    - #### trackedByCDC

          public boolean trackedByCDC()

    - #### 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`

    - #### simpleBuilder

          public static Mutation.SimpleBuilder simpleBuilder(java.lang.String keyspaceName,
                                                             DecoratedKey partitionKey)

      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.

Copyright © 2018 The Apache Software Foundation