Package org.apache.cassandra.batchlog
Class Batch
java.lang.Object
org.apache.cassandra.batchlog.Batch
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic BatchcreateLocal(TimeUUID id, long creationTime, Collection<Mutation> mutations) Creates a 'local' batch - with all enclosed mutations in decoded form (as Mutation instances)static BatchcreateRemote(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.booleanisLocal()Local batches contain only already decodedMutationinstances.intsize()Count of the mutations in the batch.
-
Field Details
-
serializer
-
id
-
creationTime
public final long creationTime
-
-
Method Details
-
createLocal
Creates a 'local' batch - with all enclosed mutations in decoded form (as Mutation instances) -
createRemote
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
-
isLocal
public boolean isLocal()Local batches contain only already decodedMutationinstances. Unlike remote batches, which contain mutations encoded asByteBufferinstances, local batches can be serialized and sent over the wire.- Returns:
trueif there are no encoded mutations present, andfalseotherwise
-