Specifying DSE database and graph settings
Some DSE Graph options are set on a per-graph basis.
The settings are modified and read using either System or Schema API calls in the Gremlin console.
These option values are stored in DSE tables and are not set in the dse.yaml
file.
See the DSG reference for a complete list of traversal options.
Other settings for DSG are also in the dse.yaml
file.
Procedure
Most per-graph options are set using the Schema API.
-
Check all non-default values of configuration settings.
schema.config().describe()
graph.tx_groups.default.write_consistency: ALL graph.tx_groups.default.read_consistency: QUORUM
Default settings are not displayed with this call.
-
Check the values of a specific setting.
schema.config().option('graph.tx_groups.default.write_consistency').get()
ALL
-
Set the value of a configuration setting.
schema.config().option('graph.tx_groups.default.write_consistency').set('ALL')
null
-
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()
REAL_TIME
-
Set the maximum time to wait for a traversal to evaluate:
schema.config().option("graph.traversal_sources.g.evaluation_timeout").set('PT2H')
The timeout values can also be entered in seconds or minutes, as appropriate, using
set('1500 ms')
, for example.
Setting a timeout value 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: evaluation_timeout
, system_evaluation_timeout
, analytic_evaluation_timeout
, and realtime_evaluation_timeout
.
+
PT2H
+
The |
-
Some options must be set using the System API.
-
Settings can also be set while creating a new graph. For instance, replication for graph inherits DSE database defaults, so the replication factor is set to
1
and the class isSimpleStrategy
. As with the DSE database, the replication factor for graph should be set before adding data.system.graph('gizmo'). replication("{'class' : 'NetworkTopologyStrategy', 'dc1' : 3 }"). ifNotExists().create()
-
Graph also creates a keyspace for storing graph variables in DSE tables. This keyspace holds essential information, so the replication factor should be set to something higher than one replica to ensure no loss.
gremlin> system.graph('gizmo'). replication("{'class' : 'NetworkTopologyStrategy', 'dc1' : 3 }"). systemReplication("{'class' : 'NetworkTopologyStrategy', 'dc1' : 3 }"). ifNotExists().create()
-
Additional schema settings can be configured at graph creation.
system.graph('food2'). replication("{'class' : 'SimpleStrategy', 'replication_factor' : 1 }"). systemReplication("{'class' : 'SimpleStrategy', 'replication_factor' : 1 }"). option("graph.schema_mode").set("Development"). option("graph.allow_scan").set("false"). option("graph.default_property_key_cardinality").set("multiple"). option("graph.tx_groups.*.write_consistency").set("ALL"). create()
More information can be found in the Schema API reference.
-
The Graph API is used to set some transaction settings.
-
The
allow_scan
option can be set at either a single graph level or as shown here, for all actions within a transaction made on a single node. This setting can be useful if a quorum cannot be mustered for writing the option change to the system table.graph.tx().config().option("allow_scan", true).open()
null