Re: how can i remove the index


李平 <lipin...@...>
 

BaseConfiguration baseConfiguration = new BaseConfiguration();
baseConfiguration.setProperty("storage.backend", "hbase");
baseConfiguration.setProperty("storage.hostname", "192.168.1.108");
baseConfiguration.setProperty("gremlin.graph", "org.janusgraph.core.JanusGraphFactory");
JanusGraph janusGraph = JanusGraphFactory.open(baseConfiguration);
JanusGraphManagement janusGraphManagement = janusGraph.openManagement();
JanusGraphIndex phoneIndex = janusGraphManagement.getGraphIndex("phoneIndex");
PropertyKey phone = janusGraphManagement.getPropertyKey("phone");
SchemaStatus indexStatus = phoneIndex.getIndexStatus(phone);
System.out.println(indexStatus);
if (indexStatus == INSTALLED) {
ManagementSystem.awaitGraphIndexStatus(janusGraph,"phoneIndex").call();
janusGraphManagement.updateIndex(phoneIndex, SchemaAction.REGISTER_INDEX).get();
}
janusGraphManagement.commit();
janusGraph.tx().commit();


it can not turn to register status,exception is  timeout 
10:54:19.148 [main] DEBUG org.janusgraph.graphdb.database.management.GraphIndexStatusWatcher - Key phone has status INSTALLED
10:54:19.148 [main] INFO org.janusgraph.graphdb.database.management.GraphIndexStatusWatcher - Some key(s) on index phoneIndex do not currently have status REGISTERED: phone=INSTALLED
10:54:19.148 [main] INFO org.janusgraph.graphdb.database.management.GraphIndexStatusWatcher - Timed out (PT1M) while waiting for index phoneIndex to converge on status REGISTERED


在 2017年7月22日星期六 UTC+8上午12:15:20,David Pitera写道:

Your propertyKey `phone` on your index `phoneIndex` is in the `INSTALLED` state, so you need to `REGISTER` it and wait for it to become registered before you can attempt to `enable` it. After it is enabled, you can disable and then remove it.

Some code that should help cause it goes through the whole installed/registered/enabled phase is:




On Thu, Jul 20, 2017 at 11:43 PM, 李平 <li...@...> wrote:
public class GraphTest {

public static void main(String[] args) throws Exception {

BaseConfiguration baseConfiguration = new BaseConfiguration();
baseConfiguration.setProperty("storage.backend", "hbase");
baseConfiguration.setProperty("storage.hostname", "192.168.1.108");
baseConfiguration.setProperty("gremlin.graph", "org.janusgraph.core.JanusGraphFactory");
JanusGraph janusGraph = JanusGraphFactory.open(baseConfiguration);
GraphTraversalSource g = janusGraph.traversal();
g.tx().rollback();
JanusGraphManagement janusGraphManagement = janusGraph.openManagement();
JanusGraphIndex phoneIndex = janusGraphManagement.getGraphIndex("phoneIndex");
janusGraphManagement.updateIndex(phoneIndex, SchemaAction.DISABLE_INDEX).get();
janusGraphManagement.commit();
g.tx().commit();
ManagementSystem.awaitGraphIndexStatus(janusGraph,"phoneIndex")
.status(SchemaStatus.DISABLED)
.timeout(10, ChronoUnit.MINUTES)
.call();
janusGraphManagement.updateIndex(phoneIndex, SchemaAction.REMOVE_INDEX).get();
janusGraphManagement.commit();
janusGraph.tx().commit();
System.out.println("---------------------remove index sucess...");

the log is :Some key(s) on index phoneIndex do not currently have status DISABLED: phone=INSTALLED


--
You received this message because you are subscribed to the Google Groups "JanusGraph users list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.