Search in sources :

Example 11 with OperationBatch

use of com.alibaba.graphscope.groot.operation.OperationBatch in project GraphScope by alibaba.

the class IngestorWriteService method writeIngestor.

@Override
public void writeIngestor(WriteIngestorRequest request, StreamObserver<WriteIngestorResponse> responseObserver) {
    try {
        int queueId = request.getQueueId();
        String requestId = request.getRequestId();
        OperationBatch operationBatch = OperationBatch.parseProto(request.getOperationBatch());
        this.ingestService.ingestBatch(requestId, queueId, operationBatch, new IngestCallback() {

            @Override
            public void onSuccess(long snapshotId) {
                WriteIngestorResponse response = WriteIngestorResponse.newBuilder().setSnapshotId(snapshotId).build();
                responseObserver.onNext(response);
                responseObserver.onCompleted();
            }

            @Override
            public void onFailure(Exception e) {
                responseObserver.onError(e);
            }
        });
    } catch (Exception e) {
        responseObserver.onError(e);
    }
}
Also used : WriteIngestorResponse(com.alibaba.maxgraph.proto.groot.WriteIngestorResponse) OperationBatch(com.alibaba.graphscope.groot.operation.OperationBatch)

Aggregations

OperationBatch (com.alibaba.graphscope.groot.operation.OperationBatch)11 Map (java.util.Map)5 MetricsCollector (com.alibaba.graphscope.groot.metrics.MetricsCollector)4 Configs (com.alibaba.maxgraph.common.config.Configs)4 HashMap (java.util.HashMap)4 CompletionCallback (com.alibaba.graphscope.groot.CompletionCallback)3 MetaService (com.alibaba.graphscope.groot.meta.MetaService)3 LogReader (com.alibaba.graphscope.groot.wal.LogReader)3 ReadLogEntry (com.alibaba.graphscope.groot.wal.ReadLogEntry)3 IOException (java.io.IOException)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 ExecutionException (java.util.concurrent.ExecutionException)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 Test (org.junit.jupiter.api.Test)3 BatchSender (com.alibaba.graphscope.groot.ingestor.BatchSender)2 MetricsAgent (com.alibaba.graphscope.groot.metrics.MetricsAgent)2 OperationBlob (com.alibaba.graphscope.groot.operation.OperationBlob)2 StoreDataBatch (com.alibaba.graphscope.groot.operation.StoreDataBatch)2 VertexId (com.alibaba.graphscope.groot.operation.VertexId)2 LogEntry (com.alibaba.graphscope.groot.wal.LogEntry)2