Package org.apache.cassandra.batchlog
Class Batch
- java.lang.Object
-
- org.apache.cassandra.batchlog.Batch
-
public final class Batch extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Batch.Serializer
-
Field Summary
Fields Modifier and Type Field Description long
creationTime
TimeUUID
id
static Batch.Serializer
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 decodedMutation
instances.int
size()
Count of the mutations in the batch.
-
-
-
Field Detail
-
serializer
public static final Batch.Serializer serializer
-
id
public final TimeUUID id
-
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 decodedMutation
instances. Unlike remote batches, which contain mutations encoded asByteBuffer
instances, local batches can be serialized and sent over the wire.- Returns:
true
if there are no encoded mutations present, andfalse
otherwise
-
-