Class GraphOptions
The default graph options to use for a DSE cluster.
These options will be used for all graph statements sent to the cluster, unless they have been explicitly overridden at the statement level.
Inherited Members
Namespace: Cassandra.DataStax.Graph
Assembly: Cassandra.dll
Syntax
public class GraphOptions
Constructors
GraphOptions()
Creates a new instance of GraphOptions.
Declaration
public GraphOptions()
Fields
DefaultLanguage
Default value for graph language.
Declaration
public const string DefaultLanguage = "gremlin-groovy"
Field Value
Type | Description |
---|---|
string |
DefaultReadTimeout
Default value for read timeout.
Declaration
public const int DefaultReadTimeout = -1
Field Value
Type | Description |
---|---|
int |
DefaultSource
Default value for graph source.
Declaration
public const string DefaultSource = "g"
Field Value
Type | Description |
---|---|
string |
Properties
GraphProtocolVersion
If not explicitly specified, the following rules apply:
Declaration
public GraphProtocol? GraphProtocolVersion { get; }
Property Value
Type | Description |
---|---|
GraphProtocol? |
Language
Gets the graph language to use in graph queries. The default is DefaultLanguage.
Declaration
public string Language { get; }
Property Value
Type | Description |
---|---|
string |
Name
Gets the graph name to use in graph queries.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
ReadConsistencyLevel
Gets the consistency level used for read queries
Declaration
public ConsistencyLevel? ReadConsistencyLevel { get; }
Property Value
Type | Description |
---|---|
ConsistencyLevel? |
ReadTimeoutMillis
Gets the value that overrides the default per-host read timeout in milliseconds for all graph queries.
Default: Timeout.Infinite
(-1).
Declaration
public int ReadTimeoutMillis { get; }
Property Value
Type | Description |
---|---|
int |
See Also
Source
Gets the graph traversal source name in graph queries.
Declaration
public string Source { get; }
Property Value
Type | Description |
---|---|
string |
WriteConsistencyLevel
Gets the consistency level used for read queries
Declaration
public ConsistencyLevel? WriteConsistencyLevel { get; }
Property Value
Type | Description |
---|---|
ConsistencyLevel? |
Methods
SetGraphProtocolVersion(GraphProtocol)
Sets the graph protocol version to use in graph queries. See GraphProtocolVersion.
Declaration
public GraphOptions SetGraphProtocolVersion(GraphProtocol version)
Parameters
Type | Name | Description |
---|---|---|
GraphProtocol | version |
Returns
Type | Description |
---|---|
GraphOptions |
SetLanguage(string)
Sets the graph language to use in graph queries. If you don't call this method, it defaults to DefaultLanguage.
Declaration
public GraphOptions SetLanguage(string language)
Parameters
Type | Name | Description |
---|---|---|
string | language |
Returns
Type | Description |
---|---|
GraphOptions |
SetName(string)
Sets the graph name to use in graph queries.
Declaration
public GraphOptions SetName(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
Returns
Type | Description |
---|---|
GraphOptions |
SetReadConsistencyLevel(ConsistencyLevel)
Sets the consistency level for the read graph queries.
Declaration
public GraphOptions SetReadConsistencyLevel(ConsistencyLevel consistency)
Parameters
Type | Name | Description |
---|---|---|
ConsistencyLevel | consistency | The consistency level to use in read graph queries. |
Returns
Type | Description |
---|---|
GraphOptions |
SetReadTimeoutMillis(int)
Sets the default per-host read timeout in milliseconds for all graph queries.
When setting a value of less than or equals to zero (Infinite), it will use an infinite timeout.
Declaration
public GraphOptions SetReadTimeoutMillis(int timeout)
Parameters
Type | Name | Description |
---|---|---|
int | timeout |
Returns
Type | Description |
---|---|
GraphOptions |
SetSource(string)
Sets the graph traversal source name to use in graph queries. If you don't call this method, it defaults to DefaultSource.
Declaration
public GraphOptions SetSource(string source)
Parameters
Type | Name | Description |
---|---|---|
string | source |
Returns
Type | Description |
---|---|
GraphOptions |
SetSourceAnalytics()
Sets the graph source to the server-defined analytic traversal source ('a')
Declaration
public GraphOptions SetSourceAnalytics()
Returns
Type | Description |
---|---|
GraphOptions |
SetWriteConsistencyLevel(ConsistencyLevel)
Sets the consistency level for the write graph queries.
Declaration
public GraphOptions SetWriteConsistencyLevel(ConsistencyLevel consistency)
Parameters
Type | Name | Description |
---|---|---|
ConsistencyLevel | consistency | The consistency level to use in write graph queries. |
Returns
Type | Description |
---|---|
GraphOptions |