Reputation: 3856
I'm using janusgraph 0.5.2 with Cassandra and elastic search. I wanted to create mixes indices.
I followed the docs and created my script as below. Basically I'm closing all open transactions and then creating the mixed index.
size = graph.getOpenTransactions().size();
for(i=0;i<size;i++) {graph.getOpenTransactions().getAt(0).rollback()}
mgmt = graph.openManagement()
taxNoKey = mgmt.getPropertyKey('taxNo')
mgmt.buildIndex('taxNo_mixed', Vertex.class).addKey(taxNoKey).buildMixedIndex("search")
mgmt.commit()
ManagementSystem.awaitGraphIndexStatus(graph, 'taxNo_mixed').status(SchemaStatus.REGISTERED, SchemaStatus.ENABLED).call()
mgmt = graph.openManagement()
mgmt.updateIndex(mgmt.getGraphIndex("taxNo_mixed"), SchemaAction.REINDEX).get()
mgmt.commit()
After mgmt.updateIndex(mgmt.getGraphIndex("taxNo_mixed"), SchemaAction.REINDEX).get()
It get the below error.
ERROR org.janusgraph.graphdb.database.management.ManagementLogger - Evicted [2@7f00010124289-ivis-SYS-7039A-I1] from cache but waiting too long for transactions to close. Stale transaction alert on: [standardjanusgraphtx[0x332460d4], standardjanusgraphtx[0x3de388c0], standardjanusgraphtx[0x39dc0ba4], standardjanusgraphtx[0x33efa7d4]] ==>org.janusgraph.diskstorage.keycolumnvalue.scan.StandardScanMetrics@3054cdd3
Any help is appreciated, thanks
Upvotes: 0
Views: 150
Reputation: 1581
JanusGraph can also have problems creating indices when one of the instances that once opened the graph, was not properly closed. JanusGraph has the following manual procedure to force closure afterwards:
mgmt = graph.openManagement()
mgmt.getOpenInstances() //all open instances
==>7f0001016161-dunwich1(current)
==>7f0001016161-atlantis1
mgmt.forceCloseInstance('7f0001016161-atlantis1') //remove an instance
mgmt.commit()
Upvotes: 2