Class Mutation

  • All Implemented Interfaces:
    java.util.function.Supplier<Mutation>, IMutation

    public class Mutation
    extends java.lang.Object
    implements IMutation, java.util.function.Supplier<Mutation>
    • Constructor Detail

      • Mutation

        public Mutation​(java.lang.String keyspaceName,
                        DecoratedKey key,
                        com.google.common.collect.ImmutableMap<TableId,​PartitionUpdate> modifications,
                        long approxCreatedAtNanos)
      • Mutation

        public Mutation​(java.lang.String keyspaceName,
                        DecoratedKey key,
                        com.google.common.collect.ImmutableMap<TableId,​PartitionUpdate> modifications,
                        long approxCreatedAtNanos,
                        boolean cdcEnabled)
    • Method Detail

      • getApproxCreatedAtNanos

        public long getApproxCreatedAtNanos()
      • get

        public Mutation get()
        Specified by:
        get in interface java.util.function.Supplier<Mutation>
      • 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 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​(java.util.concurrent.TimeUnit unit)
        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
      • serializedSize

        public int serializedSize​(int version)
      • 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.