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 configuration
Option argument Setting Example Description Default

replication_config (replaced by replication in DSE 5.1.3 and later)

{ 'class' : 'NetworkTopologyStrategy', 'dc1' : 3 }

Set replication configuration for a single graph.

{'class' : 'SimpleStrategy', 'replication_factor' : 1 }

system_replication_config (replaced by systemReplication in DSE 5.1.3 and later)

{ 'class' : 'NetworkTopologyStrategy', 'dc1' : 3 }

Set replication configuration for a single graph_system data.

{'class' : 'SimpleStrategy', 'replication_factor' : 1 }

default_property_key_cardinality

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 graph_name and graph_name_system keyspaces.

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 (graph.replication_config and graph.system_replication_config) have been replaced in DSE 5.1.3 and later; see the table above.

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.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com