Search in sources :

Example 1 with SetPrestoConfDirResponse

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

the class ManagerProcessContext method startSetPrestoConfDirListener.

/**
 * Starts a request stream observer for {@link HostedManagerServiceGrpc} SetPrestoConfDir
 * RPC calls.
 */
public void startSetPrestoConfDirListener() {
    HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
    RequestStreamObserver requestObserver = new RequestStreamObserver<SetPrestoConfDirRequest, SetPrestoConfDirResponse>() {

        @Override
        public SetPrestoConfDirResponse exec(SetPrestoConfDirRequest req) {
            Preconditions.checkArgument(req.hasPayload());
            Preconditions.checkArgument(req.getPayload().hasConfDir());
            return SetPrestoConfDirResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(setPrestoConfDir(req)).build();
        }

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

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

Aggregations

RequestStreamObserver (alluxio.hub.manager.rpc.observer.RequestStreamObserver)1 HostedManagerServiceGrpc (alluxio.hub.proto.HostedManagerServiceGrpc)1 SetPrestoConfDirRequest (alluxio.hub.proto.SetPrestoConfDirRequest)1 SetPrestoConfDirResponse (alluxio.hub.proto.SetPrestoConfDirResponse)1 ByteString (com.google.protobuf.ByteString)1