Search in sources :

Example 1 with VertexLabelMaker

use of org.janusgraph.core.schema.VertexLabelMaker in project janusgraph by JanusGraph.

the class JanusGraphGrpcServerBaseTest method createVertexLabel.

public long createVertexLabel(String graph, VertexLabelOrBuilder vertexLabel) {
    JanusGraphManagement management = ((JanusGraph) graphManager.getGraph(graph)).openManagement();
    VertexLabelMaker vertexLabelMaker = management.makeVertexLabel(vertexLabel.getName());
    if (vertexLabel.getReadOnly()) {
        vertexLabelMaker.setStatic();
    }
    if (vertexLabel.getPartitioned()) {
        vertexLabelMaker.partition();
    }
    VertexLabel createdVertexLabel = vertexLabelMaker.make();
    management.commit();
    return createdVertexLabel.longId();
}
Also used : JanusGraphManagement(org.janusgraph.core.schema.JanusGraphManagement) VertexLabel(org.janusgraph.core.VertexLabel) JanusGraph(org.janusgraph.core.JanusGraph) VertexLabelMaker(org.janusgraph.core.schema.VertexLabelMaker)

Aggregations

JanusGraph (org.janusgraph.core.JanusGraph)1 VertexLabel (org.janusgraph.core.VertexLabel)1 JanusGraphManagement (org.janusgraph.core.schema.JanusGraphManagement)1 VertexLabelMaker (org.janusgraph.core.schema.VertexLabelMaker)1