Search in sources :

Example 1 with DdlRequestBlob

use of com.alibaba.graphscope.groot.schema.request.DdlRequestBlob in project GraphScope by alibaba.

the class DdlExecutors method executeDdlRequestBatch.

public DdlResult executeDdlRequestBatch(DdlRequestBatch ddlRequestBatch, GraphDef graphDef, int partitionCount) throws InvalidProtocolBufferException {
    List<Operation> operations = new ArrayList<>();
    GraphDef tmpGraphDef = graphDef;
    for (DdlRequestBlob ddlRequestBlob : ddlRequestBatch) {
        OperationType operationType = ddlRequestBlob.getOperationType();
        ByteString ddlBlob = ddlRequestBlob.getBytes();
        DdlResult ddlResult = getExecutor(operationType).execute(ddlBlob, tmpGraphDef, partitionCount);
        operations.addAll(ddlResult.getDdlOperations());
        tmpGraphDef = ddlResult.getGraphDef();
    }
    return new DdlResult(tmpGraphDef, operations);
}
Also used : ByteString(com.google.protobuf.ByteString) ArrayList(java.util.ArrayList) DdlRequestBlob(com.alibaba.graphscope.groot.schema.request.DdlRequestBlob) Operation(com.alibaba.graphscope.groot.operation.Operation) OperationType(com.alibaba.graphscope.groot.operation.OperationType) GraphDef(com.alibaba.maxgraph.sdkcommon.schema.GraphDef)

Aggregations

Operation (com.alibaba.graphscope.groot.operation.Operation)1 OperationType (com.alibaba.graphscope.groot.operation.OperationType)1 DdlRequestBlob (com.alibaba.graphscope.groot.schema.request.DdlRequestBlob)1 GraphDef (com.alibaba.maxgraph.sdkcommon.schema.GraphDef)1 ByteString (com.google.protobuf.ByteString)1 ArrayList (java.util.ArrayList)1