public class SimpleGraphStatement extends RegularGraphStatement
Modifier and Type | Field and Description |
---|---|
protected SimpleStatement |
statement |
Constructor and Description |
---|
SimpleGraphStatement(String query) |
SimpleGraphStatement(String query,
Map<String,Object> valuesMap) |
Modifier and Type | Method and Description |
---|---|
GraphStatement |
executingAs(String userOrRole)
Allows this statement to be executed as a different user/role than the one currently
authenticated (a.k.a.
|
ConsistencyLevel |
getConsistencyLevel()
Returns the consistency level to use with this statement.
|
long |
getDefaultTimestamp()
The default timestamp for this query.
|
String |
getQueryString()
Returns the graph query string for this statement.
|
int |
getReadTimeoutMillis()
Return the per-host socket read timeout that was set for this statement.
|
SimpleGraphStatement |
set(String name,
Object value)
Sets a parameter on this statement.
|
GraphStatement |
setConsistencyLevel(ConsistencyLevel consistencyLevel)
Sets the consistency level to use for this statement.
|
GraphStatement |
setDefaultTimestamp(long defaultTimestamp)
Sets the default timestamp for this query (in microseconds since the epoch).
|
GraphStatement |
setReadTimeoutMillis(int readTimeoutMillis)
Overrides the default per-host read timeout (
GraphOptions.setReadTimeoutMillis(int) )
for this statement. |
SimpleStatement |
unwrap()
Deprecated.
|
SimpleStatement |
unwrap(GraphOptions graphOptions)
"Unwraps" the current graph statement, that is, returns an executable
Statement object
corresponding to this graph statement. |
SimpleStatement |
unwrap(GraphProtocol graphProtocol)
Deprecated.
|
getGraphInternalOption, getGraphLanguage, getGraphName, getGraphReadConsistencyLevel, getGraphSource, getGraphWriteConsistencyLevel, getTransformResultFunction, isIdempotent, isSystemQuery, setGraphInternalOption, setGraphLanguage, setGraphName, setGraphReadConsistencyLevel, setGraphSource, setGraphWriteConsistencyLevel, setIdempotent, setSystemQuery, setTransformResultFunction
protected SimpleStatement statement
public SimpleGraphStatement(String query)
public String getQueryString()
RegularGraphStatement
getQueryString
in class RegularGraphStatement
public SimpleGraphStatement set(String name, Object value)
Note that, contrary to CQL parameters, which are identified either by a bind marker "?" or by the sign ":" in front of a parameter name, parameters in Gremlin queries are simply referenced by their names. Please refer to Gremlin's documentation for more information.
Parameter values can be of any type supported by the subprotocol in use: Boolean, Integer,
Long, Float, Double, String, Map, List, GraphNode
, Element
, any geospatial
type.
name
- the parameter name, as referenced in the graph query.value
- the parameter value.public GraphStatement setConsistencyLevel(ConsistencyLevel consistencyLevel)
GraphStatement
This setting will affect the general consistency when executing the graph query. However
executing a graph query on the server side is going to involve the execution of CQL queries to
the persistence engine that is Cassandra. Those queries can be both reads and writes and both
will have a settable consistency level. Setting only this property will indicate to the server
to use this consistency level for both reads and writes in Cassandra. Read or write consistency
level can be set separately with respectively GraphStatement.setGraphReadConsistencyLevel(ConsistencyLevel)
and GraphStatement.setGraphWriteConsistencyLevel(ConsistencyLevel)
and will override the
consistency set here.
setConsistencyLevel
in class GraphStatement
consistencyLevel
- the consistency level to set.GraphStatement
instance (for method chaining).public ConsistencyLevel getConsistencyLevel()
GraphStatement
This will return the consistency level used for reads and writes in Cassandra.
Please see GraphStatement.setConsistencyLevel(ConsistencyLevel)
for more
information.
getConsistencyLevel
in class GraphStatement
public GraphStatement setDefaultTimestamp(long defaultTimestamp)
GraphStatement
The actual timestamp that will be used for this query is, in order of preference:
Long.MIN_VALUE
;
TimestampGenerator
currently in use, if different from Long.MIN_VALUE
.
setDefaultTimestamp
in class GraphStatement
defaultTimestamp
- the default timestamp for this query (must be strictly positive).GraphStatement
instance (for method chaining).DseCluster.Builder.withTimestampGenerator(com.datastax.driver.core.TimestampGenerator)
public int getReadTimeoutMillis()
GraphStatement
getReadTimeoutMillis
in class GraphStatement
GraphOptions.getReadTimeoutMillis()
will be used.public GraphStatement setReadTimeoutMillis(int readTimeoutMillis)
GraphStatement
GraphOptions.setReadTimeoutMillis(int)
)
for this statement.
If you don't call this method, the default GraphOptions.getReadTimeoutMillis()
will
be used.
setReadTimeoutMillis
in class GraphStatement
readTimeoutMillis
- the timeout to set. 0
will disable the timeout for the query,
negative values are not allowed.GraphOptions
instance (for method chaining).public long getDefaultTimestamp()
GraphStatement
getDefaultTimestamp
in class GraphStatement
@Deprecated public SimpleStatement unwrap()
GraphStatement
GraphOptions
object is required to produce a valid
Statement
. Use GraphStatement.unwrap(GraphOptions)
instead.
This method will call GraphStatement#unwrap(GraphProtocol.GRAPHSON_1_0)
.
unwrap
in class RegularGraphStatement
Statement
.@Deprecated public SimpleStatement unwrap(GraphProtocol graphProtocol)
GraphStatement
GraphOptions
object is required to produce a valid
Statement
. Use GraphStatement.unwrap(GraphOptions)
instead.
This method will call GraphStatement#unwrap(new
GraphOptions().setGraphSubProtocol(graphProtocol))
.
unwrap
in class GraphStatement
public SimpleStatement unwrap(GraphOptions graphOptions)
GraphStatement
Statement
object
corresponding to this graph statement.
This method is intended for internal use only, users wishing to execute graph statements
should use DseSession.executeGraph(GraphStatement)
.
This method acts as a bridge between graph statements and regular Statement
s.
Implementations are free to cache the returned Statement
if appropriate.
unwrap
in class GraphStatement
graphOptions
- the graph options required to encode the statement's parameters into the
correct sub-protocol format.Statement
.public GraphStatement executingAs(String userOrRole)
GraphStatement
This feature is only available in DSE 5.1+.
executingAs
in class GraphStatement
userOrRole
- The user or role name to act as when executing this statement.Copyright © 2012–2019. All rights reserved.