3

I have some questions when I build a JanusGraph Mixed index. This is my code:

mgmt = graph.openManagement();
idx = mgmt.getGraphIndex('zhh1_index');
prop = mgmt.getPropertyKey('zhang');
mgmt.addIndexKey(idx, prop);
prop = mgmt.getPropertyKey('uri');
mgmt.addIndexKey(idx, prop);
prop = mgmt.getPropertyKey('age');
mgmt.addIndexKey(idx, prop);
mgmt.commit();
mgmt.awaitGraphIndexStatus(graph, 'zhh1_index').status(SchemaStatus.REGISTERED).call();
mgmt = graph.openManagement();
mgmt.updateIndex(mgmt.getGraphIndex('zhh1_index'),SchemaAction.ENABLE_INDEX).get();
mgmt.commit();
vertex2=graph.addVertex(label,'zhh1');
vertex2.property('zhang','male');
vertex2.property('uri','/zhh1/zhanghh');
vertex2.property('age','18');
vertex3=graph.addVertex(label,'zhh1');
vertex3.property('zhang','male');
vertex3.property('uri','/zhh1/zhangheng');

When the program executes this line:

mgmt.awaitGraphIndexStatus(graph, 'zhh1_index').status(SchemaStatus.REGISTERED).call();

the the log prints these information (and about 30s later, an exception like this: the sleep was interrupt):

GraphIndexStatusReport[success=false, indexName='zhh1_index', targetStatus=ENABLED, notConverged={jiyq=INSTALLED, zhang=INSTALLED, uri=INSTALLED, age=INSTALLED}, converged={}, elapsed=PT1M0.096S]

I was so confused about this!

It keeps printing a lot for all indexes I have. Am I doing anything wrong? How to avoid such message?

When I execute the following statement separately, the following exception is reported:

exception:java.util.concurrent.ExecutionException: mgmt.updateIndex(mgmt.getGraphIndex('zhh1_index'),SchemaAction.ENABLE_INDEX).get(); org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Cannot invoke method get() on null object

juwuba
  • 73
  • 1
  • 9

2 Answers2

1

Your index seems to be stuck in the INSTALLED state, which may happening due to a few reasons: please see this post and look at my answer-- specifically bullet numbers 2,3, and 5.

David
  • 486
  • 2
  • 9
0

When did you buildMixedIndex() ? REINDEX procedure may be required.

takaomag
  • 1,545
  • 1
  • 16
  • 26
  • this mixedIndex has bean build before, when i try to build a new mixedIndex, this problem will show again – juwuba Sep 04 '17 at 02:59