org.janusgraph.core.schema.SchemaAction Java Examples

The following examples show how to use org.janusgraph.core.schema.SchemaAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RepairIndex.java    From atlas with Apache License 2.0 6 votes vote down vote up
private void restoreAll() throws Exception {
    for (String indexName : getIndexes()){
        displayCrlf("Restoring: " + indexName);
        long startTime = System.currentTimeMillis();

        ManagementSystem mgmt = (ManagementSystem) graph.openManagement();
        JanusGraphIndex index = mgmt.getGraphIndex(indexName);
        mgmt.updateIndex(index, SchemaAction.REINDEX).get();
        mgmt.commit();

        ManagementSystem.awaitGraphIndexStatus(graph, indexName).status(SchemaStatus.ENABLED).call();

        display(": Time taken: " + (System.currentTimeMillis() - startTime) + " ms");
        displayCrlf(": Done!");
    }
}
 
Example #2
Source File: RecreateWeightIndex.java    From janusgraph_tutorial with Apache License 2.0 5 votes vote down vote up
private void reindexFor(String label, String propertyKey) throws BackendException, ExecutionException, InterruptedException {
  LOGGER.info("Reindexing index for edge {} and property {} using map reduce", label, propertyKey);

  MapReduceIndexManagement mr = new MapReduceIndexManagement(graph);
  JanusGraphIndex index = mgt.getGraphIndex(Schema.indexName(label, propertyKey));
  mr.updateIndex(index, SchemaAction.REINDEX).get();
}
 
Example #3
Source File: RecreateWeightIndex.java    From janusgraph_tutorial with Apache License 2.0 4 votes vote down vote up
private void deleteIndex(String label, String propertyKey) {
  LOGGER.info("Deleting index for edge {} and property {}", label, propertyKey);
  JanusGraphIndex index = mgt.getGraphIndex(Schema.indexName(label, propertyKey));
  mgt.updateIndex(index, SchemaAction.REMOVE_INDEX);
}