canbax
canbax

Reputation: 3856

Cannot create mixed index in JanusGraph

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

  1. My graph is not big, it contains 200k nodes and 400k edges
  2. I'm copy-pasting to gremlin shell? Is it ok?
  3. Should there be any specific settings in elastic search for creating an index?

Any help is appreciated, thanks

Upvotes: 0

Views: 150

Answers (1)

HadoopMarc
HadoopMarc

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

Related Questions