Package net.quasardb.qdb.batch
Class Batch
java.lang.Object
net.quasardb.qdb.batch.Batch
- All Implemented Interfaces:
AutoCloseable
Batches multiple operations into a single atomic operation.
Improves efficiency by avoiding many round-trips from client to server by using
a single large operation.
Enables better consistency by atomically applying all operations in a single
batch: either all operations succeed, or none do.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic enumprotected static classstatic classBatch options. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBatch(Session session, Batch.Options options) Construct a new Batch. -
Method Summary
Modifier and TypeMethodDescriptionstatic Batch.BuilderCreate a builder instance.voidclose()Explicitly close batch.voidcommit()protected voidfinalize()booleanisEmpty()Returns true if there are no operations in the batch.session()Get access to the underlying session object.intsize()Returns the amount of operations in this batch.
-
Constructor Details
-
Batch
Construct a new Batch.
-
-
Method Details
-
builder
Create a builder instance.- Parameters:
session- Active connection with the QuasarDB cluster.
-
size
public int size()Returns the amount of operations in this batch. -
isEmpty
public boolean isEmpty()Returns true if there are no operations in the batch. -
session
Get access to the underlying session object. -
close
public void close()Explicitly close batch.- Specified by:
closein interfaceAutoCloseable
-
finalize
-
blob
-
string
-
integer
-
double_
-
timestamp
-
commit
public void commit()
-