Search in sources :

Example 1 with DetectPrestoResponse

use of alluxio.hub.proto.DetectPrestoResponse in project alluxio by Alluxio.

the class ManagerProcessContext method startDetectPrestoListener.

/**
 * Starts a request stream observer for {@link HostedManagerServiceGrpc} DetectPresto RPC calls.
 */
public void startDetectPrestoListener() {
    HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
    RequestStreamObserver requestObserver = new RequestStreamObserver<DetectPrestoRequest, DetectPrestoResponse>() {

        @Override
        public DetectPrestoResponse exec(DetectPrestoRequest req) {
            return DetectPrestoResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(detectPresto(req)).build();
        }

        @Override
        public void restart() {
            startDetectPrestoListener();
        }

        @Override
        public void handleError(String message, Throwable t) {
            handleStatusRuntimeException(message, t);
        }
    };
    StreamObserver<DetectPrestoResponse> responseObserver = asyncStub.detectPresto(requestObserver);
    requestObserver.start(responseObserver, DetectPrestoResponse.newBuilder().setHubMetadata(mHubMetadata).build());
    LOG.info("Started DetectPresto async listener", asyncStub);
}
Also used : DetectPrestoRequest(alluxio.hub.proto.DetectPrestoRequest) AgentDetectPrestoRequest(alluxio.hub.proto.AgentDetectPrestoRequest) RequestStreamObserver(alluxio.hub.manager.rpc.observer.RequestStreamObserver) DetectPrestoResponse(alluxio.hub.proto.DetectPrestoResponse) AgentDetectPrestoResponse(alluxio.hub.proto.AgentDetectPrestoResponse) HostedManagerServiceGrpc(alluxio.hub.proto.HostedManagerServiceGrpc) ByteString(com.google.protobuf.ByteString)

Aggregations

RequestStreamObserver (alluxio.hub.manager.rpc.observer.RequestStreamObserver)1 AgentDetectPrestoRequest (alluxio.hub.proto.AgentDetectPrestoRequest)1 AgentDetectPrestoResponse (alluxio.hub.proto.AgentDetectPrestoResponse)1 DetectPrestoRequest (alluxio.hub.proto.DetectPrestoRequest)1 DetectPrestoResponse (alluxio.hub.proto.DetectPrestoResponse)1 HostedManagerServiceGrpc (alluxio.hub.proto.HostedManagerServiceGrpc)1 ByteString (com.google.protobuf.ByteString)1