config
Synopsis
schema.config().option(arg).[ set(value) | unset(value) | get() | exists() | describe() ]
Schema can be configured per graph using the config()
command.
An option and value can be set()
or unset()
.
An option’s value can be retrieved with the get()
command.
Whether or not the option is configured can be discovered with the exists()
command.
The describe()
command returns a value if the option has been set manually.
Graph-specific options
Graph-specific options are preceded by graph
. For example,`graph.schema_mode.
Option argument | Setting Example | Description | Default |
---|---|---|---|
|
true |
Setting to allow costly graph scan queries. |
true |
|
Production |
Set mode to Production or Development. |
Development |
|
multiple |
Set the cardinality that will be used by default unless otherwise specified. |
single |
|
true |
Set whether transactions are started automatically or must be manually opened. |
false |
TraversalSource-specific options
graph.traversal_sources.*
where * must be a specified traversal source such as the graph traversal
g. For example, graph.traversal_sources.g.type
. The most common TraversalSource
is the
graph traversal g.
Option argument | Setting Example | Description | Default |
---|---|---|---|
|
PT10S (10 seconds) or "1500 ms" |
Maximum time to wait for a traversal to evaluate - this will override other system level settings for the current TraversalSource. |
0 days |
|
false |
Prevent the use of lambdas with this TraversalSource. A particular traversal source can be identified. |
true |
|
read-only |
Specify type of TraversalSource. A particular traversal source can be identified. |
default |
Setting a timeout value of greater than 1095 days (maximum integer) can exceed the limit of a graph session.
Starting a new session and setting the timeout to a lower value can recover access to a hung session.
This caution is applicable for all timeouts: |
Transaction-specific options
Transaction-specific options are preceded by graph.tx_groups.*
where * must be specified as a
transaction group or default
. For example, graph.tx_groups.default.read_only
will make all
transactions which aren’t explicitly named read_only
, whereas graph.tx_groups.myTxGroup.read_only
would apply only to transactions which are given the group name myTxGroup.
Option | Setting Example | Description | Default |
---|---|---|---|
|
test_user |
The username to use as the current user for a transaction. |
|
|
true |
Cache retrievals and data store calls within a transaction in transaction-level caches. This setting provides a restricted type of isolation within a transaction (concurrent modifications in other transactions aren’t visible and result sets remain consistent between calls) and can improve performance at the expense of additional memory consumption. |
true |
|
true |
Enable CQL tracing for |
false |
|
true |
Set whether a transaction should verify that vertices for internally provided vertex ids (autogenerated vertex ids) actually exist. |
false |
|
false |
Set whether a transaction should verify that vertices for externally provided vertex ids (custom vertex ids) actually exist. |
true |
|
true |
Use a logged batch when committing changes. This guarantees that all mutations will eventually occur at the expense of performance. |
false |
|
5000 |
The maximum number of vertices, properties and edges (cumulatively) that may be added or removed in a single transaction. |
10000 |
|
5 |
The maximum number of profiling events to report for an individual traversal step. Restricting the number of reported events makes output manageable, but can hide important information. |
10 |
|
true |
Sets whether the query executor should asynchronously pre-fetch data based on its expected execution of the traversal prior to the data being requested. This can reduce transaction latency but can cause throughput to worse. |
true |
|
true |
Set whether a transaction is read-only. |
false |
|
|
Specify the consistency level for read operations of a transaction. |
|
|
true |
Set whether a transaction is only accessed by a single thread. |
false |
|
true |
Set whether a transaction is bound to a particular thread. |
false |
|
The timestamp at which all mutations of this transaction are persisted. |
|
|
|
false |
Set whether transactions should ensure that uniqueness constraints are enforced. |
true |
|
4000 |
Maximum size of the transaction-level cache of recently-used vertices |
20000l |
|
This is a performance hint for write-heavy, performance-sensitive transactional workloads. If set, it should roughly match the median vertices modified per transaction. |
32 |
|
|
|
Specify the consistency level for write operations of a transaction |
|
Description
Configure a graph.
Options can be set
, unset
, or get
(retrieve the value).
Examples
Set the current graph to disallow full graph scans in the currently aliased graph.
schema.config().option('graph.allow_scan').set('false')
To retrieve all traversal sources that have been set, use the get()
command with the traversal source type option:
schema.config().option('graph.traversal_sources.*.type').get()
resulting in a list of values for the option that have been manually set:
REAL_TIME
Set the default write consistency for a transaction to ALL
in the currently aliased graph.
schema.config().option('graph.tx_groups.default.write_consistency').set('ALL')
Get the current write consistency for a transaction in the currently aliased graph.
schema.config().option('graph.tx_groups.default.write_consistency').get()
To confirm that an option setting has been set manually, use the exists() command:
schema.config().option('graph.tx_groups.default.write_consistency').exists()
This returns:
true
if the setting has been set to a value, otherwise it returns false
.
To enable CQL tracing during traversal query profiling, set the deep_profiling()
option:
schema.config().option('graph.tx_groups.default.deep_profiling').set('TRUE')
To verify that external vertex ids exist, set the external_vertex_verify()
option:
schema.config().option('graph.tx_groups.default.external_vertex_verify').set('TRUE')
If this setting is true, then a vertex will not be returned if it doesn’t exist.
However, if external_vertex_verify()
is set to false, then a vertex will be returned even if the vertex does not exist given an id.
Applications should ensure that vertices exist using the exists()
method for expected behavior.
To retrieve a list of configuration options that have been set, use the describe()
command:
schema.config().describe()
resulting in a list of all options that have been manually set:
graph.tx_groups.default.write_consistency: ALL graph.allow_scan: False
There are some configuration options for which the default (for example, values are not explicitly set) is determined by using the value of other configuration options.
For instance, if allow_scan
is not explicitly set, the default value is true
if schema_mode
is set to Development
, but false
if the schema_mode
is set to Production
.
These configuration options are not linked to the default settings, leading to potentially misleading information when using schema.config().get()
to discover the setting value because the default value is displayed rather than a set value.
To set restrict_lambda
to FALSE
in order to test lambda functions (only appropriate for non-production systems):
schema.config().option('graph.traversal_sources.g.restrict_lambda').set('FALSE')
Full graph scan settings are as follows:
setting | schema mode | scans allowed |
---|---|---|
|
Production |
no |
|
Development |
yes |
|
Production |
no |
|
Development |
no |
|
Production |
yes |
|
Development |
yes |