Search in sources :

Example 1 with StoreDataBatchPb

use of com.alibaba.maxgraph.proto.groot.StoreDataBatchPb in project GraphScope by alibaba.

the class StoreWriteService method writeStore.

@Override
public void writeStore(WriteStoreRequest request, StreamObserver<WriteStoreResponse> responseObserver) {
    List<StoreDataBatchPb> dataBatchesList = request.getDataBatchesList();
    List<StoreDataBatch> batches = new ArrayList<>(dataBatchesList.size());
    try {
        for (StoreDataBatchPb pb : dataBatchesList) {
            batches.add(StoreDataBatch.parseProto(pb));
        }
        boolean success = writerAgent.writeStore2(batches);
        WriteStoreResponse response = WriteStoreResponse.newBuilder().setSuccess(success).build();
        responseObserver.onNext(response);
        responseObserver.onCompleted();
    } catch (Exception e) {
        responseObserver.onError(e);
    }
}
Also used : WriteStoreResponse(com.alibaba.maxgraph.proto.groot.WriteStoreResponse) StoreDataBatch(com.alibaba.graphscope.groot.operation.StoreDataBatch) ArrayList(java.util.ArrayList) StoreDataBatchPb(com.alibaba.maxgraph.proto.groot.StoreDataBatchPb)

Aggregations

StoreDataBatch (com.alibaba.graphscope.groot.operation.StoreDataBatch)1 StoreDataBatchPb (com.alibaba.maxgraph.proto.groot.StoreDataBatchPb)1 WriteStoreResponse (com.alibaba.maxgraph.proto.groot.WriteStoreResponse)1 ArrayList (java.util.ArrayList)1