Search in sources :

Example 56 with IndexLabel

use of com.baidu.hugegraph.structure.schema.IndexLabel in project incubator-hugegraph-toolchain by apache.

the class RebuildAPI method rebuildIndex.

private long rebuildIndex(SchemaElement element) {
    E.checkArgument(element instanceof VertexLabel || element instanceof EdgeLabel || element instanceof IndexLabel, "Only VertexLabel, EdgeLabel and IndexLabel support " + "rebuild, but got '%s'", element);
    String path = String.join(PATH_SPLITOR, this.path(), element.type());
    RestResult result = this.client.put(path, element.name(), element);
    @SuppressWarnings("unchecked") Map<String, Object> task = result.readObject(Map.class);
    return TaskAPI.parseTaskId(task);
}
Also used : RestResult(com.baidu.hugegraph.rest.RestResult) VertexLabel(com.baidu.hugegraph.structure.schema.VertexLabel) IndexLabel(com.baidu.hugegraph.structure.schema.IndexLabel) EdgeLabel(com.baidu.hugegraph.structure.schema.EdgeLabel)

Aggregations

IndexLabel (com.baidu.hugegraph.structure.schema.IndexLabel)56 Test (org.junit.Test)34 HugeClient (com.baidu.hugegraph.driver.HugeClient)14 SchemaManager (com.baidu.hugegraph.driver.SchemaManager)11 ArrayList (java.util.ArrayList)10 ServerException (com.baidu.hugegraph.exception.ServerException)9 ExternalException (com.baidu.hugegraph.exception.ExternalException)8 Task (com.baidu.hugegraph.structure.Task)7 VertexLabel (com.baidu.hugegraph.structure.schema.VertexLabel)7 PropertyIndex (com.baidu.hugegraph.entity.schema.PropertyIndex)6 EdgeLabel (com.baidu.hugegraph.structure.schema.EdgeLabel)6 Date (java.util.Date)6 RestResult (com.baidu.hugegraph.rest.RestResult)4 HashSet (java.util.HashSet)4 SchemaType (com.baidu.hugegraph.entity.schema.SchemaType)2 PropertyKey (com.baidu.hugegraph.structure.schema.PropertyKey)2 TasksWithPage (com.baidu.hugegraph.api.task.TasksWithPage)1 Constant (com.baidu.hugegraph.common.Constant)1 ConflictDetail (com.baidu.hugegraph.entity.schema.ConflictDetail)1 ConflictStatus (com.baidu.hugegraph.entity.schema.ConflictStatus)1