public interface BatchGraphStatement extends GraphStatement<BatchGraphStatement>, Iterable<org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal>
It is reserved for graph mutations, and does not return any result.
All the mutations grouped in the batch will either all succeed, or they will all be discarded and return an error.
The default implementation returned by the driver is immutable and thread-safe. Each mutation
operation returns a copy. If you chain many of those operations, it is recommended to use builder()
instead for better memory usage.
Typically used like so:
import static com.datastax.dse.driver.api.core.graph.DseGraph.g;
BatchGraphStatement statement =
BatchGraphStatement.builder()
.addTraversal(
g.addV("person").property("name", "batch1").property("age", 1))
.addTraversal(
g.addV("person").property("name", "batch2").property("age", 2))
.build();
GraphResultSet graphResultSet = dseSession.execute(statement);
DseGraph.g
ASYNC, SYNC
Modifier and Type | Method and Description |
---|---|
BatchGraphStatement |
addTraversal(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal traversal)
Add a traversal to this statement.
|
BatchGraphStatement |
addTraversals(Iterable<org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal> traversals)
Adds several traversals to this statement.
|
static BatchGraphStatementBuilder |
builder()
Create a builder helper object to start creating a new instance.
|
static BatchGraphStatementBuilder |
builder(BatchGraphStatement template)
Create a builder helper object to start creating a new instance with an existing statement as a
template.
|
static BatchGraphStatement |
newInstance()
Create a new, empty instance.
|
static BatchGraphStatement |
newInstance(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal... traversals)
Create a new instance from the given list of traversals.
|
static BatchGraphStatement |
newInstance(Iterable<org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal> traversals)
Create a new instance from the given list of traversals.
|
int |
size()
Get the number of traversals already added to this statement.
|
getConsistencyLevel, getGraphName, getKeyspace, getReadConsistencyLevel, getRoutingKey, getRoutingKeyspace, getRoutingToken, getSubProtocol, getTimeout, getTimestamp, getTraversalSource, getWriteConsistencyLevel, isTracing, setConsistencyLevel, setCustomPayload, setExecutionProfile, setExecutionProfileName, setGraphName, setIdempotent, setNode, setReadConsistencyLevel, setSubProtocol, setTimeout, setTimestamp, setTraversalSource, setWriteConsistencyLevel
getCustomPayload, getExecutionProfile, getExecutionProfileName, getNode, getPartitioner, isIdempotent
forEach, iterator, spliterator
@NonNull static BatchGraphStatement newInstance()
Traversals can be added with addTraversal(GraphTraversal)
.
@NonNull static BatchGraphStatement newInstance(@NonNull Iterable<org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal> traversals)
@NonNull static BatchGraphStatement newInstance(@NonNull org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal... traversals)
@NonNull static BatchGraphStatementBuilder builder()
Note that this builder is mutable and not thread-safe.
@NonNull static BatchGraphStatementBuilder builder(@NonNull BatchGraphStatement template)
Note that this builder is mutable and not thread-safe.
@NonNull BatchGraphStatement addTraversal(@NonNull org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal traversal)
builder()
, or the addTraversals(Iterable)
method instead to avoid intermediary
copies.@NonNull BatchGraphStatement addTraversals(@NonNull Iterable<org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal> traversals)
builder()
instead to avoid intermediary copies.int size()
Copyright © 2017–2024. All rights reserved.