dingyiz's picture
Upload folder using huggingface_hub
2795186 verified

Cassandra CQL Storage, Elasticsearch Index

About Cassandra and Elasticsearch

Apache Cassandra is a distributed database designed for scalability and high availability. Cassandra supports two protocols for communications, Thrift (legacy RPC protocol) and CQL (native protocol).

Elasticsearch is a scalable, distributed search engine.

Check the JanusGraph version compatibility to ensure you select versions of Cassandra and Elasticsearch compatible with this JanusGraph release.

JanusGraph configuration

  • jgex-cql.properties contains the Cassandra and Elasticsearch server locations. By providing different values for storage.cql.keyspace and index.jgex.index-name, you can store multiple graphs on the same Cassandra and Elasticsearch servers. Refer to the JanusGraph configuration reference for additional properties.

Cassandra configuration

The JanusGraph properties file assumes that Cassandra is installed on localhost using its default configuration. Please refer to the Cassandra documentation for installation instructions.

Elasticsearch configuration

The JanusGraph properties file assumes that Elasticsearch is installed on localhost using its default configuration. Please refer to the Elasticsearch documentation for installation instructions.

JanusGraph pre-packaged distribution

Rather than installing Cassandra and Elasticsearch separately, the JanusGraph pre-packaged distribution is provided for convenience. The distribution starts a local Cassandra, Elasticsearch, and Gremlin Server.

Dependencies

The required Maven dependency for Cql:

        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-cql</artifactId>
            <version>${janusgraph.version}</version>
            <scope>runtime</scope>
        </dependency>

The required Maven dependency for Elasticsearch:

        <dependency>
            <groupId>org.janusgraph</groupId>
            <artifactId>janusgraph-es</artifactId>
            <version>${janusgraph.version}</version>
            <scope>runtime</scope>
        </dependency>

Run the example

This command can be run from the examples or the project's directory.

mvn exec:java -pl :example-cql

Drop the graph

After running an example, you may want to drop the graph from storage. Make sure to stop the application before dropping the graph. This command can be run from the examples or the project's directory.

mvn exec:java -pl :example-cql -Dcmd=drop