Search in sources :

Example 46 with VertexLabel

use of com.baidu.hugegraph.structure.schema.VertexLabel 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

VertexLabel (com.baidu.hugegraph.structure.schema.VertexLabel)46 Test (org.junit.Test)31 HugeClient (com.baidu.hugegraph.driver.HugeClient)7 IndexLabel (com.baidu.hugegraph.structure.schema.IndexLabel)7 SchemaManager (com.baidu.hugegraph.driver.SchemaManager)6 ExternalException (com.baidu.hugegraph.exception.ExternalException)5 ServerException (com.baidu.hugegraph.exception.ServerException)5 Edge (com.baidu.hugegraph.structure.graph.Edge)5 ArrayList (java.util.ArrayList)5 Date (java.util.Date)5 RestResult (com.baidu.hugegraph.rest.RestResult)3 Vertex (com.baidu.hugegraph.structure.graph.Vertex)3 EdgeLabel (com.baidu.hugegraph.structure.schema.EdgeLabel)3 PropertyKey (com.baidu.hugegraph.structure.schema.PropertyKey)2 VertexLabelEntity (com.baidu.hugegraph.entity.schema.VertexLabelEntity)1 VertexLabelStyle (com.baidu.hugegraph.entity.schema.VertexLabelStyle)1 Record (com.baidu.hugegraph.loader.builder.Record)1 VertexBuilder (com.baidu.hugegraph.loader.builder.VertexBuilder)1 ParseException (com.baidu.hugegraph.loader.exception.ParseException)1 ElementMapping (com.baidu.hugegraph.loader.mapping.ElementMapping)1