Search in sources :

Example 1 with ApplyMountPointResponse

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

the class ManagerProcessContext method startApplyMountPointListener.

/**
 * Starts a request stream observer for {@link HostedManagerServiceGrpc} ApplyMountPoint
 * RPC calls.
 */
public void startApplyMountPointListener() {
    HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
    RequestStreamObserver requestObserver = new RequestStreamObserver<ApplyMountPointRequest, ApplyMountPointResponse>() {

        @Override
        public ApplyMountPointResponse exec(ApplyMountPointRequest req) {
            return ApplyMountPointResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(applyMount(req)).build();
        }

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

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

Aggregations

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