Class Batch

java.lang.Object
org.apache.cassandra.batchlog.Batch

public final class Batch extends Object
  • Field Details

    • serializer

      public static final Batch.Serializer serializer
    • id

      public final TimeUUID id
    • creationTime

      public final long creationTime
  • Method Details

    • createLocal

      public static Batch createLocal(TimeUUID id, long creationTime, Collection<Mutation> mutations)
      Creates a 'local' batch - with all enclosed mutations in decoded form (as Mutation instances)
    • createRemote

      public static Batch createRemote(TimeUUID id, long creationTime, Collection<ByteBuffer> mutations)
      Creates a 'remote' batch - with all enclosed mutations in encoded form (as ByteBuffer instances) The mutations will always be encoded using the current messaging version.
    • size

      public int size()
      Count of the mutations in the batch.
    • getEncodedMutations

      public Collection<ByteBuffer> getEncodedMutations()
    • isLocal

      public boolean isLocal()
      Local batches contain only already decoded Mutation instances. Unlike remote batches, which contain mutations encoded as ByteBuffer instances, local batches can be serialized and sent over the wire.
      Returns:
      true if there are no encoded mutations present, and false otherwise