public class GraphOptions extends Object
These options will be used for all graph statements sent to the cluster, unless they have been
explicitly overridden at the statement level (by using methods such as GraphStatement.setGraphName(String)
).
Graph options are specified at cluster initialization with DseCluster.Builder.withGraphOptions(GraphOptions)
, and can be retrieved
at runtime with dseCluster.getConfiguration().getGraphOptions()
.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_GRAPH_LANGUAGE
The default value for
getGraphLanguage() ("gremlin-groovy"). |
static String |
DEFAULT_GRAPH_SOURCE
The default value for
getGraphSource() ("g"). |
Constructor and Description |
---|
GraphOptions() |
Modifier and Type | Method and Description |
---|---|
Map<String,ByteBuffer> |
buildPayloadWithDefaults(GraphStatement statement)
Builds the custom payload for the given statement, providing defaults from these graph options
if necessary.
|
String |
getGraphLanguage()
Returns the graph language to use in graph queries.
|
String |
getGraphName()
Returns the graph name to use in graph queries.
|
ConsistencyLevel |
getGraphReadConsistencyLevel()
Returns the read consistency level to use in graph queries.
|
String |
getGraphSource()
Returns the graph traversal source name to use in graph queries.
|
GraphProtocol |
getGraphSubProtocol()
Return the graph sub protocol set for all queries.
|
ConsistencyLevel |
getGraphWriteConsistencyLevel()
Returns the write consistency level to use in graph queries.
|
int |
getReadTimeoutMillis()
Return the per-host socket read timeout that is set for all graph queries.
|
GraphOptions |
setGraphLanguage(String graphLanguage)
Sets the graph language to use in graph queries.
|
GraphOptions |
setGraphName(String graphName)
Sets the graph name to use in graph queries.
|
GraphOptions |
setGraphReadConsistencyLevel(ConsistencyLevel cl)
Sets the read consistency level to use for graph queries.
|
GraphOptions |
setGraphSource(String graphSource)
Sets the graph traversal source name to use in graph queries.
|
GraphOptions |
setGraphSubProtocol(GraphProtocol graphSubProtocol)
Set the sub protocol to use with DSE Graph.
|
GraphOptions |
setGraphWriteConsistencyLevel(ConsistencyLevel cl)
Sets the write consistency level to use for graph queries.
|
GraphOptions |
setReadTimeoutMillis(int readTimeoutMillis)
Sets the per-host read timeout in milliseconds for graph queries.
|
public static final String DEFAULT_GRAPH_LANGUAGE
getGraphLanguage()
("gremlin-groovy").public static final String DEFAULT_GRAPH_SOURCE
getGraphSource()
("g").public String getGraphLanguage()
setGraphLanguage(String)
public GraphOptions setGraphLanguage(String graphLanguage)
This property is required. If you don't call this method, it defaults to "gremlin-groovy".
graphLanguage
- the graph language to use in graph queries.GraphOptions
instance (for method chaining).public String getGraphSource()
setGraphSource(String)
public GraphOptions setGraphSource(String graphSource)
This property is required. If you don't call this method, it defaults to "g".
graphSource
- the graph traversal source name to use in graph queries.GraphOptions
instance (for method chaining).public String getGraphName()
setGraphName(String)
public GraphOptions setGraphName(String graphName)
This property is optional. If you don't call this method, it is left unset.
graphName
- The Graph name to use in graph queries.GraphOptions
instance (for method chaining).public ConsistencyLevel getGraphReadConsistencyLevel()
public GraphOptions setGraphReadConsistencyLevel(ConsistencyLevel cl)
This setting will override the consistency level set with GraphStatement.setConsistencyLevel(ConsistencyLevel)
only for the READ part of the graph
query.
Please see GraphStatement.setConsistencyLevel(ConsistencyLevel)
for more
information.
cl
- the consistency level to set.GraphOptions
instance (for method chaining).public ConsistencyLevel getGraphWriteConsistencyLevel()
public GraphOptions setGraphWriteConsistencyLevel(ConsistencyLevel cl)
This setting will override the consistency level set with GraphStatement.setConsistencyLevel(ConsistencyLevel)
only for the write part of the graph
query.
Please see GraphStatement.setConsistencyLevel(ConsistencyLevel)
for more
information.
cl
- the consistency level to set.GraphStatement
instance (for method chaining).public int getReadTimeoutMillis()
public GraphOptions setReadTimeoutMillis(int readTimeoutMillis)
Only call this method if you want to wait less than the server's default timeout (defined in
dse.yaml
). Note that the server will abort a query once the client has stopped waiting
for it, so there's no risk of leaving long-running queries on the server.
readTimeoutMillis
- the timeout to set.GraphOptions
instance (for method chaining).public GraphOptions setGraphSubProtocol(GraphProtocol graphSubProtocol)
GraphProtocol
for more information.graphSubProtocol
- the sub protocol to chooseGraphOptions
instance (for method chaining).public GraphProtocol getGraphSubProtocol()
public Map<String,ByteBuffer> buildPayloadWithDefaults(GraphStatement statement)
This method is intended for internal use only.
statement
- the statement.Copyright © 2012–2019. All rights reserved.