Class Mutation

java.lang.Object
org.apache.cassandra.db.Mutation
All Implemented Interfaces:
Supplier<Mutation>, IMutation

public class Mutation extends Object implements IMutation, Supplier<Mutation>
  • Field Details

  • Constructor Details

  • Method Details

    • without

      public Mutation without(Set<TableId> tableIds)
    • without

      public Mutation without(TableId tableId)
    • getKeyspaceName

      public String getKeyspaceName()
      Specified by:
      getKeyspaceName in interface IMutation
    • getTableIds

      public Collection<TableId> getTableIds()
      Specified by:
      getTableIds in interface IMutation
    • key

      public DecoratedKey key()
      Specified by:
      key in interface IMutation
    • getPartitionUpdates

      public com.google.common.collect.ImmutableCollection<PartitionUpdate> getPartitionUpdates()
      Specified by:
      getPartitionUpdates in interface IMutation
    • getApproxCreatedAtNanos

      public long getApproxCreatedAtNanos()
    • hintOnFailure

      public Supplier<Mutation> hintOnFailure()
      Specified by:
      hintOnFailure in interface IMutation
    • get

      public Mutation get()
      Specified by:
      get in interface Supplier<Mutation>
    • validateSize

      public void validateSize(int version, int overhead)
      Description copied from interface: IMutation
      Validates size of mutation does not exceed DatabaseDescriptor.getMaxMutationSize().
      Specified by:
      validateSize in interface IMutation
      Parameters:
      version - the MessagingService version the mutation is being serialized for. see MessagingService.current_version
      overhead - overhadd to add for mutation size to validate. Pass zero if not required but not a negative value.
    • getPartitionUpdate

      public PartitionUpdate getPartitionUpdate(TableMetadata table)
    • isEmpty

      public boolean isEmpty()
    • merge

      public static Mutation merge(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:
      IllegalArgumentException - if not all the mutations are on the same keyspace and key.
    • applyFuture

      public Future<?> 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()
    • getTimeout

      public long getTimeout(TimeUnit unit)
      Specified by:
      getTimeout in interface IMutation
    • smallestGCGS

      public int smallestGCGS()
    • trackedByCDC

      public boolean trackedByCDC()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(boolean shallow)
      Specified by:
      toString in interface IMutation
    • serializedSize

      public int serializedSize(int version)
    • simpleBuilder

      public static Mutation.SimpleBuilder simpleBuilder(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.