Class Batch


  • public final class Batch
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Batch.Serializer  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Batch createLocal​(TimeUUID id, long creationTime, java.util.Collection<Mutation> mutations)
      Creates a 'local' batch - with all enclosed mutations in decoded form (as Mutation instances)
      static Batch createRemote​(TimeUUID id, long creationTime, java.util.Collection<java.nio.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.
      java.util.Collection<java.nio.ByteBuffer> getEncodedMutations()  
      boolean isLocal()
      Local batches contain only already decoded Mutation instances.
      int size()
      Count of the mutations in the batch.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • creationTime

        public final long creationTime
    • Method Detail

      • createLocal

        public static Batch createLocal​(TimeUUID id,
                                        long creationTime,
                                        java.util.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,
                                         java.util.Collection<java.nio.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 java.util.Collection<java.nio.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