Search in sources :

Example 1 with GetPrestoConfDirResponse

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

the class ManagerProcessContext method startGetPrestoConfDirListener.

/**
 * Starts a request stream observer for {@link HostedManagerServiceGrpc} GetPrestoConfDir
 * RPC calls.
 */
public void startGetPrestoConfDirListener() {
    HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
    RequestStreamObserver requestObserver = new RequestStreamObserver<GetPrestoConfDirRequest, GetPrestoConfDirResponse>() {

        @Override
        public GetPrestoConfDirResponse exec(GetPrestoConfDirRequest req) {
            return GetPrestoConfDirResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(getPrestoConf()).build();
        }

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

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

Aggregations

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