option
Synopsis
option(arg).set( value )
Graphs can be configured per graph using the following options.
The Gremlin console must be used to set system
commands.
Option argument | Setting Example | Description | Default |
---|---|---|---|
|
{ 'class' : 'NetworkTopologyStrategy', 'dc1' : 3 } |
Set replication configuration for a single graph. |
{'class' : 'SimpleStrategy', 'replication_factor' : 1 } |
|
{ 'class' : 'NetworkTopologyStrategy', 'dc1' : 3 } |
Set replication configuration for a single |
{'class' : 'SimpleStrategy', 'replication_factor' : 1 } |
|
Multiple |
The default cardinality for automatically defined properties |
Single |
Description
Configure a graph.
Options can be set
.
The replication factor and system replication factor cannot be altered once set for the |
Examples
Create a new graph and set the graph replication configuration and the graph_system replication configuration to the DSE database settings shown.
system.graph('food'). option("graph.replication_config").set("{'class' : 'NetworkTopologyStrategy', 'dc1' : 3 }"). option("graph.system_replication_config").set("{'class' : 'NetworkTopologyStrategy', 'dc1' : 3 }"). ifNotExists().create()
The resulting list:
==>null
The replication settings can be verified using the cqlsh
tool, running the CQL command DESCRIBE keyspace food;
.
The options shown ( |
Other schema settings can be set at graph creation, but must be changed using schema.config()
if modified later.
system.graph('food2').
option("graph.replication_config").set("{'class' : 'SimpleStrategy', 'replication_factor' : 1 }").
option("graph.system_replication_config").set("{'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()
To check the schema settings:
:remote config alias g food2.g
schema.config().describe()
to get the results:
graph.schema_mode: Development
graph.allow_scan: False
graph.tx_groups.*.write_consistency: ALL
graph.default_property_key_cardinality: Multiple
gremlin> schema.config().option("graph.allow_scan").set("true")
Note the use of a wildcard *
to set the write consistency for all transaction groups.