Search in sources :

Example 1 with ListMountPointResponse

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

the class ManagerProcessContext method startListMountPointsListener.

/**
 * Starts a request stream observer for {@link HostedManagerServiceGrpc} ListMountPoints
 * RPC calls.
 */
public void startListMountPointsListener() {
    HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
    RequestStreamObserver requestObserver = new RequestStreamObserver<ListMountPointRequest, ListMountPointResponse>() {

        @Override
        public ListMountPointResponse exec(ListMountPointRequest req) {
            ListMountPointResponse.Payload p = getMountPointList();
            return ListMountPointResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(p).build();
        }

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

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

Aggregations

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