Search in sources :

Example 1 with DeleteMountPointRequest

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

the class ManagerProcessContext method startDeleteMountPointListener.

/**
 * Starts a request stream observer for {@link HostedManagerServiceGrpc} DeleteMountPoint
 * RPC calls.
 */
public void startDeleteMountPointListener() {
    HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
    RequestStreamObserver requestObserver = new RequestStreamObserver<DeleteMountPointRequest, DeleteMountPointResponse>() {

        @Override
        public DeleteMountPointResponse exec(DeleteMountPointRequest req) {
            return DeleteMountPointResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(deleteMount(req.getPayload().getMountPoint())).build();
        }

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

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

Aggregations

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