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 class
static enum
protected static class
static class
Batch options. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Batch
(Session session, Batch.Options options) Construct a new Batch. -
Method Summary
Modifier and TypeMethodDescriptionstatic Batch.Builder
Create a builder instance.void
close()
Explicitly close batch.void
commit()
protected void
finalize()
boolean
isEmpty()
Returns true if there are no operations in the batch.session()
Get access to the underlying session object.int
size()
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:
close
in interfaceAutoCloseable
-
finalize
-
blob
-
string
-
integer
-
double_
-
timestamp
-
commit
public void commit()
-