How Do You Get Indexes In JanusGraph-Cassandra With Java? #3774
-
ProblemHow are you supposed to make vertex indexes when writing in Java? Exception in thread "main" java.lang.IllegalArgumentException: Update action [ENABLE_INDEX] cannot be invoked for index with status [INSTALLED]
at org.janusgraph.core.schema.SchemaAction.isApplicableStatus(SchemaAction.java:85)
at org.janusgraph.graphdb.database.management.ManagementSystem.updateIndex(ManagementSystem.java:864)
at org.janusgraph.graphdb.database.management.ManagementSystem.updateIndex(ManagementSystem.java:845)
at Test12.main(Test12.java:39) janusGraphManagement.buildIndex("_id", Vertex.class).addKey(propertyKey).buildCompositeIndex(); DisclaimerPlease know that before you read the rest of this -> I know that:
My mind has been greatly exercised with unfamiliar terms, uncertain avenues to test, and defending my right to learn and ask questions. I don't claim to be smart about this or that I don't (mis)understand things; I could just use some help. How do you create an index for a large-volume sparse-dataset load? Research(I think) I know:
LogsC:\Users\zmurray\.jdks\corretto-17.0.7\bin\java.exe "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.2\lib\idea_rt.jar=61535:C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.2\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\zmurray\git\Tom_Sawyer_Software\TSS-Graph_Database_Research\Janusgraph\neo4jCsv-2-Janusgraph\target\test-classes;C:\Users\zmurray\git\Tom_Sawyer_Software\TSS-Graph_Database_Research\Janusgraph\neo4jCsv-2-Janusgraph\target\classes;C:\Users\zmurray\.m2\repository\org\apache\logging\log4j\log4j-slf4j2-impl\2.20.0\log4j-slf4j2-impl-2.20.0.jar;C:\Users\zmurray\.m2\repository\org\apache\logging\log4j\log4j-api\2.20.0\log4j-api-2.20.0.jar;C:\Users\zmurray\.m2\repository\org\slf4j\slf4j-api\2.0.6\slf4j-api-2.0.6.jar;C:\Users\zmurray\.m2\repository\org\apache\logging\log4j\log4j-core\2.20.0\log4j-core-2.20.0.jar;C:\Users\zmurray\.m2\repository\org\janusgraph\janusgraph-cql\1.0.0-20230504-014643.988c094\janusgraph-cql-1.0.0-20230504-014643.988c094.jar;C:\Users\zmurray\.m2\repository\org\janusgraph\janusgraph-core\1.0.0-20230504-014643.988c094\janusgraph-core-1.0.0-20230504-014643.988c094.jar;C:\Users\zmurray\.m2\repository\org\janusgraph\janusgraph-driver\1.0.0-20230504-014643.988c094\janusgraph-driver-1.0.0-20230504-014643.988c094.jar;C:\Users\zmurray\.m2\repository\org\apache\tinkerpop\gremlin-core\3.6.2\gremlin-core-3.6.2.jar;C:\Users\zmurray\.m2\repository\org\apache\tinkerpop\gremlin-shaded\3.6.2\gremlin-shaded-3.6.2.jar;C:\Users\zmurray\.m2\repository\org\apache\tinkerpop\gremlin-language\3.6.2\gremlin-language-3.6.2.jar;C:\Users\zmurray\.m2\repository\org\antlr\antlr4-runtime\4.9.1\antlr4-runtime-4.9.1.jar;C:\Users\zmurray\.m2\repository\org\javatuples\javatuples\1.2\javatuples-1.2.jar;C:\Users\zmurray\.m2\repository\org\yaml\snakeyaml\1.32\snakeyaml-1.32.jar;C:\Users\zmurray\.m2\repository\com\jcabi\jcabi-manifests\1.2.1\jcabi-manifests-1.2.1.jar;C:\Users\zmurray\.m2\repository\com\jcabi\jcabi-log\0.20.0\jcabi-log-0.20.0.jar;C:\Users\zmurray\.m2\repository\net\objecthunter\exp4j\0.4.8\exp4j-0.4.8.jar;C:\Users\zmurray\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.25\jcl-over-slf4j-1.7.25.jar;C:\Users\zmurray\.m2\repository\org\apache\tinkerpop\gremlin-driver\3.6.2\gremlin-driver-3.6.2.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-all\4.1.86.Final\netty-all-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-buffer\4.1.86.Final\netty-buffer-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec\4.1.86.Final\netty-codec-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-dns\4.1.86.Final\netty-codec-dns-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-haproxy\4.1.86.Final\netty-codec-haproxy-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-http\4.1.86.Final\netty-codec-http-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-http2\4.1.86.Final\netty-codec-http2-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-memcache\4.1.86.Final\netty-codec-memcache-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-mqtt\4.1.86.Final\netty-codec-mqtt-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-redis\4.1.86.Final\netty-codec-redis-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-smtp\4.1.86.Final\netty-codec-smtp-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-socks\4.1.86.Final\netty-codec-socks-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-stomp\4.1.86.Final\netty-codec-stomp-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-codec-xml\4.1.86.Final\netty-codec-xml-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-common\4.1.86.Final\netty-common-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-handler\4.1.86.Final\netty-handler-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-native-unix-common\4.1.86.Final\netty-transport-native-unix-common-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-handler-proxy\4.1.86.Final\netty-handler-proxy-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-handler-ssl-ocsp\4.1.86.Final\netty-handler-ssl-ocsp-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-resolver\4.1.86.Final\netty-resolver-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-resolver-dns\4.1.86.Final\netty-resolver-dns-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport\4.1.86.Final\netty-transport-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-rxtx\4.1.86.Final\netty-transport-rxtx-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-sctp\4.1.86.Final\netty-transport-sctp-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-udt\4.1.86.Final\netty-transport-udt-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-classes-epoll\4.1.86.Final\netty-transport-classes-epoll-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-classes-kqueue\4.1.86.Final\netty-transport-classes-kqueue-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-resolver-dns-classes-macos\4.1.86.Final\netty-resolver-dns-classes-macos-4.1.86.Final.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-native-epoll\4.1.86.Final\netty-transport-native-epoll-4.1.86.Final-linux-x86_64.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-native-epoll\4.1.86.Final\netty-transport-native-epoll-4.1.86.Final-linux-aarch_64.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-native-kqueue\4.1.86.Final\netty-transport-native-kqueue-4.1.86.Final-osx-x86_64.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-transport-native-kqueue\4.1.86.Final\netty-transport-native-kqueue-4.1.86.Final-osx-aarch_64.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-resolver-dns-native-macos\4.1.86.Final\netty-resolver-dns-native-macos-4.1.86.Final-osx-x86_64.jar;C:\Users\zmurray\.m2\repository\io\netty\netty-resolver-dns-native-macos\4.1.86.Final\netty-resolver-dns-native-macos-4.1.86.Final-osx-aarch_64.jar;C:\Users\zmurray\.m2\repository\org\apache\tinkerpop\gremlin-groovy\3.6.2\gremlin-groovy-3.6.2.jar;C:\Users\zmurray\.m2\repository\org\apache\ivy\ivy\2.5.1\ivy-2.5.1.jar;C:\Users\zmurray\.m2\repository\org\codehaus\groovy\groovy\2.5.15\groovy-2.5.15-indy.jar;C:\Users\zmurray\.m2\repository\org\codehaus\groovy\groovy-groovysh\2.5.15\groovy-groovysh-2.5.15-indy.jar;C:\Users\zmurray\.m2\repository\org\codehaus\groovy\groovy-cli-picocli\2.5.15\groovy-cli-picocli-2.5.15.jar;C:\Users\zmurray\.m2\repository\info\picocli\picocli\4.3.2\picocli-4.3.2.jar;C:\Users\zmurray\.m2\repository\org\codehaus\groovy\groovy-console\2.5.15\groovy-console-2.5.15.jar;C:\Users\zmurray\.m2\repository\org\codehaus\groovy\groovy-templates\2.5.15\groovy-templates-2.5.15.jar;C:\Users\zmurray\.m2\repository\org\codehaus\groovy\groovy-xml\2.5.15\groovy-xml-2.5.15.jar;C:\Users\zmurray\.m2\repository\org\codehaus\groovy\groovy-swing\2.5.15\groovy-swing-2.5.15.jar;C:\Users\zmurray\.m2\repository\jline\jline\2.14.6\jline-2.14.6.jar;C:\Users\zmurray\.m2\repository\org\codehaus\groovy\groovy-json\2.5.15\groovy-json-2.5.15-indy.jar;C:\Users\zmurray\.m2\repository\org\codehaus\groovy\groovy-jsr223\2.5.15\groovy-jsr223-2.5.15-indy.jar;C:\Users\zmurray\.m2\repository\org\mindrot\jbcrypt\0.4\jbcrypt-0.4.jar;C:\Users\zmurray\.m2\repository\com\google\guava\guava\31.1-jre\guava-31.1-jre.jar;C:\Users\zmurray\.m2\repository\com\google\guava\failureaccess\1.0.1\failureaccess-1.0.1.jar;C:\Users\zmurray\.m2\repository\com\google\guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:\Users\zmurray\.m2\repository\com\google\j2objc\j2objc-annotations\1.3\j2objc-annotations-1.3.jar;C:\Users\zmurray\.m2\repository\org\noggit\noggit\0.8\noggit-0.8.jar;C:\Users\zmurray\.m2\repository\org\locationtech\spatial4j\spatial4j\0.8\spatial4j-0.8.jar;C:\Users\zmurray\.m2\repository\org\locationtech\jts\jts-core\1.17.0\jts-core-1.17.0.jar;C:\Users\zmurray\.m2\repository\org\apache\tinkerpop\tinkergraph-gremlin\3.6.2\tinkergraph-gremlin-3.6.2.jar;C:\Users\zmurray\.m2\repository\io\dropwizard\metrics\metrics-core\4.2.18\metrics-core-4.2.18.jar;C:\Users\zmurray\.m2\repository\io\dropwizard\metrics\metrics-graphite\4.2.18\metrics-graphite-4.2.18.jar;C:\Users\zmurray\.m2\repository\com\rabbitmq\amqp-client\5.16.0\amqp-client-5.16.0.jar;C:\Users\zmurray\.m2\repository\io\dropwizard\metrics\metrics-jmx\4.2.18\metrics-jmx-4.2.18.jar;C:\Users\zmurray\.m2\repository\net\oneandone\reflections8\reflections8\0.11.7\reflections8-0.11.7.jar;C:\Users\zmurray\.m2\repository\org\javassist\javassist\3.22.0-GA\javassist-3.22.0-GA.jar;C:\Users\zmurray\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;C:\Users\zmurray\.m2\repository\commons-configuration\commons-configuration\1.10\commons-configuration-1.10.jar;C:\Users\zmurray\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;C:\Users\zmurray\.m2\repository\org\apache\commons\commons-configuration2\2.9.0\commons-configuration2-2.9.0.jar;C:\Users\zmurray\.m2\repository\commons-io\commons-io\2.11.0\commons-io-2.11.0.jar;C:\Users\zmurray\.m2\repository\commons-codec\commons-codec\1.15\commons-codec-1.15.jar;C:\Users\zmurray\.m2\repository\com\carrotsearch\hppc\0.9.1\hppc-0.9.1.jar;C:\Users\zmurray\.m2\repository\org\jctools\jctools-core\4.0.1\jctools-core-4.0.1.jar;C:\Users\zmurray\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar;C:\Users\zmurray\.m2\repository\com\github\ben-manes\caffeine\caffeine\2.9.3\caffeine-2.9.3.jar;C:\Users\zmurray\.m2\repository\com\google\errorprone\error_prone_annotations\2.10.0\error_prone_annotations-2.10.0.jar;C:\Users\zmurray\.m2\repository\com\datastax\oss\java-driver-core\4.15.0\java-driver-core-4.15.0.jar;C:\Users\zmurray\.m2\repository\com\datastax\oss\native-protocol\1.5.1\native-protocol-1.5.1.jar;C:\Users\zmurray\.m2\repository\com\datastax\oss\java-driver-shaded-guava\25.1-jre-graal-sub-1\java-driver-shaded-guava-25.1-jre-graal-sub-1.jar;C:\Users\zmurray\.m2\repository\com\typesafe\config\1.4.1\config-1.4.1.jar;C:\Users\zmurray\.m2\repository\com\github\jnr\jnr-posix\3.1.15\jnr-posix-3.1.15.jar;C:\Users\zmurray\.m2\repository\com\github\jnr\jnr-ffi\2.2.11\jnr-ffi-2.2.11.jar;C:\Users\zmurray\.m2\repository\com\github\jnr\jffi\1.3.9\jffi-1.3.9.jar;C:\Users\zmurray\.m2\repository\com\github\jnr\jffi\1.3.9\jffi-1.3.9-native.jar;C:\Users\zmurray\.m2\repository\org\ow2\asm\asm\9.2\asm-9.2.jar;C:\Users\zmurray\.m2\repository\org\ow2\asm\asm-analysis\9.2\asm-analysis-9.2.jar;C:\Users\zmurray\.m2\repository\org\ow2\asm\asm-tree\9.2\asm-tree-9.2.jar;C:\Users\zmurray\.m2\repository\org\ow2\asm\asm-util\9.2\asm-util-9.2.jar;C:\Users\zmurray\.m2\repository\com\github\jnr\jnr-a64asm\1.0.0\jnr-a64asm-1.0.0.jar;C:\Users\zmurray\.m2\repository\com\github\jnr\jnr-x86asm\1.0.2\jnr-x86asm-1.0.2.jar;C:\Users\zmurray\.m2\repository\com\github\jnr\jnr-constants\0.10.3\jnr-constants-0.10.3.jar;C:\Users\zmurray\.m2\repository\org\hdrhistogram\HdrHistogram\2.1.12\HdrHistogram-2.1.12.jar;C:\Users\zmurray\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.13.2\jackson-core-2.13.2.jar;C:\Users\zmurray\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.13.2.2\jackson-databind-2.13.2.2.jar;C:\Users\zmurray\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.13.2\jackson-annotations-2.13.2.jar;C:\Users\zmurray\.m2\repository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;C:\Users\zmurray\.m2\repository\com\github\stephenc\jcip\jcip-annotations\1.0-1\jcip-annotations-1.0-1.jar;C:\Users\zmurray\.m2\repository\com\github\spotbugs\spotbugs-annotations\3.1.12\spotbugs-annotations-3.1.12.jar;C:\Users\zmurray\.m2\repository\com\datastax\oss\java-driver-query-builder\4.15.0\java-driver-query-builder-4.15.0.jar;C:\Users\zmurray\.m2\repository\io\vavr\vavr\0.10.4\vavr-0.10.4.jar;C:\Users\zmurray\.m2\repository\io\vavr\vavr-match\0.10.4\vavr-match-0.10.4.jar;C:\Users\zmurray\.m2\repository\com\opencsv\opencsv\5.7.1\opencsv-5.7.1.jar;C:\Users\zmurray\.m2\repository\org\apache\commons\commons-lang3\3.12.0\commons-lang3-3.12.0.jar;C:\Users\zmurray\.m2\repository\org\apache\commons\commons-text\1.10.0\commons-text-1.10.0.jar;C:\Users\zmurray\.m2\repository\commons-beanutils\commons-beanutils\1.9.4\commons-beanutils-1.9.4.jar;C:\Users\zmurray\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\zmurray\.m2\repository\org\apache\commons\commons-collections4\4.4\commons-collections4-4.4.jar Test12
2023-05-12 12:00:28,191 [INFO] [c.d.o.d.i.c.ContactPoints.main] :: Contact point localhost:9042 resolves to multiple addresses, will use them all ([localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1])
2023-05-12 12:00:28,321 [INFO] [c.d.o.d.i.c.DefaultMavenCoordinates.main] :: DataStax Java driver for Apache Cassandra(R) (com.datastax.oss:java-driver-core) version 4.15.0
2023-05-12 12:00:29,035 [INFO] [c.d.o.d.i.c.t.Clock.JanusGraph Session-admin-0] :: Using native clock for microsecond precision
2023-05-12 12:00:29,392 [WARN] [c.d.o.d.i.c.l.h.OptionalLocalDcHelper.JanusGraph Session-admin-0] :: [JanusGraph Session|default] You specified datacenter1 as the local DC, but some contact points are from a different DC: Node(endPoint=localhost/[0:0:0:0:0:0:0:1]:9042, hostId=null, hashCode=4e657eb1)=null; please provide the correct local DC, or check your contact points
2023-05-12 12:00:29,646 [INFO] [o.j.g.i.UniqueInstanceIdRetriever.main] :: Generated unique-instance-id=c0a8563c17468-rmt-lap-win201
2023-05-12 12:00:29,664 [INFO] [c.d.o.d.i.c.ContactPoints.main] :: Contact point localhost:9042 resolves to multiple addresses, will use them all ([localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1])
2023-05-12 12:00:29,700 [INFO] [c.d.o.d.i.c.t.Clock.JanusGraph Session-admin-0] :: Using native clock for microsecond precision
2023-05-12 12:00:29,752 [WARN] [c.d.o.d.i.c.l.h.OptionalLocalDcHelper.JanusGraph Session-admin-0] :: [JanusGraph Session|default] You specified datacenter1 as the local DC, but some contact points are from a different DC: Node(endPoint=localhost/127.0.0.1:9042, hostId=null, hashCode=2d899a6d)=null; please provide the correct local DC, or check your contact points
2023-05-12 12:00:29,771 [INFO] [o.j.d.c.ExecutorServiceBuilder.main] :: Initiated fixed thread pool of size 40
2023-05-12 12:00:29,889 [INFO] [o.j.g.d.StandardJanusGraph.main] :: Gremlin script evaluation is disabled
2023-05-12 12:00:29,916 [INFO] [o.j.d.l.k.KCVSLog.main] :: Loaded unidentified ReadMarker start time 2023-05-12T17:00:29.916639Z into org.janusgraph.diskstorage.log.kcvs.KCVSLog$MessagePuller@48b4a043
2023-05-12 12:00:29,976 [WARN] [o.j.g.t.StandardJanusGraphTx.main] :: Query requires iterating over all vertices [[]]. For better performance, use indexes
2023-05-12 12:00:30,203 [WARN] [o.j.g.t.StandardJanusGraphTx.main] :: Query requires iterating over all vertices [[]]. For better performance, use indexes
2023-05-12 12:00:30,207 [INFO] [Main.main] :: drop g.V().count().next(): 0
2023-05-12 12:00:30,947 [WARN] [o.j.g.t.StandardJanusGraphTx.main] :: Query requires iterating over all vertices [[]]. For better performance, use indexes
2023-05-12 12:00:30,950 [INFO] [Main.main] :: addVertex g.V().count().next(): 1
2023-05-12 12:00:31,328 [WARN] [o.j.g.t.StandardJanusGraphTx.main] :: Query requires iterating over all vertices [[]]. For better performance, use indexes
2023-05-12 12:00:31,332 [INFO] [Main.main] :: buildIndex g.V().count().next(): 1
2023-05-12 12:00:31,336 [WARN] [o.j.g.t.StandardJanusGraphTx.main] :: Query requires iterating over all vertices [[]]. For better performance, use indexes
2023-05-12 12:00:31,341 [INFO] [Main.main] :: updateIndex g.V().count().next(): 1
Exception in thread "main" java.lang.IllegalArgumentException: Update action [ENABLE_INDEX] cannot be invoked for index with status [INSTALLED]
at org.janusgraph.core.schema.SchemaAction.isApplicableStatus(SchemaAction.java:85)
at org.janusgraph.graphdb.database.management.ManagementSystem.updateIndex(ManagementSystem.java:864)
at org.janusgraph.graphdb.database.management.ManagementSystem.updateIndex(ManagementSystem.java:845)
at Test12.main(Test12.java:39)
Process finished with exit code 130 Codeimport org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.janusgraph.core.JanusGraph;
import org.janusgraph.core.JanusGraphFactory;
import org.janusgraph.core.JanusGraphVertex;
import org.janusgraph.core.PropertyKey;
import org.janusgraph.core.schema.JanusGraphManagement;
import org.janusgraph.core.schema.SchemaAction;
import org.janusgraph.graphdb.database.management.ManagementSystem;
import java.util.concurrent.ExecutionException;
public class Test12 {
private static final Logger logger = LogManager.getLogger(Main.class);
public static void main(String[] args) throws InterruptedException, ExecutionException {
JanusGraph janusGraph = JanusGraphFactory.build().set("storage.backend", "cql").set("storage.hostname", "localhost:9042").open();
GraphTraversalSource g = janusGraph.traversal();
g.V().drop().iterate();
janusGraph.tx().commit();
janusGraph.tx().open();
logger.info("drop g.V().count().next():\t" + g.V().count().next());
JanusGraphVertex vertex = janusGraph.addVertex("entity");
vertex.property("_id", "Test1");
janusGraph.tx().commit();
janusGraph.tx().open();
logger.info("addVertex g.V().count().next():\t" + g.V().count().next());
JanusGraphManagement janusGraphManagement = janusGraph.openManagement();
PropertyKey propertyKey = janusGraphManagement.getOrCreatePropertyKey("_id");
janusGraphManagement.buildIndex("_id", Vertex.class).addKey(propertyKey).buildCompositeIndex();
janusGraph.tx().commit();
janusGraph.tx().open();
logger.info("buildIndex g.V().count().next():\t" + g.V().count().next());
janusGraphManagement.updateIndex(janusGraphManagement.getGraphIndex("_id"), SchemaAction.REGISTER_INDEX).get();
janusGraph.tx().commit();
janusGraph.tx().open();
logger.info("updateIndex g.V().count().next():\t" + g.V().count().next());
janusGraphManagement.updateIndex(janusGraphManagement.getGraphIndex("_id"), SchemaAction.ENABLE_INDEX).get();
janusGraph.tx().commit();
janusGraph.tx().open();
logger.info("updateIndex g.V().count().next():\t" + g.V().count().next());
ManagementSystem.awaitGraphIndexStatus(janusGraph, "_id").call();
logger.info("awaitGraphIndexStatus g.V().count().next():\t" + g.V().count().next());
janusGraph.close();
}
} ReproductionThis execution is running with: Java-17, Maven-3, and CQL (Cassandra Query Language). OldException in thread "main" java.lang.NullPointerException: Cannot invoke "org.janusgraph.core.schema.JanusGraphIndex.getFieldKeys()" because "idx" is null
at org.janusgraph.graphdb.database.management.GraphIndexStatusWatcher.call(GraphIndexStatusWatcher.java:67)
at Test12.main(Test12.java:35) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
https://stackoverflow.com/questions/76239053/building-janusgraph-indexes-on-cassandra-in-java |
Beta Was this translation helpful? Give feedback.
https://stackoverflow.com/questions/76239053/building-janusgraph-indexes-on-cassandra-in-java