Search in sources :

Example 1 with GetConfigurationSetResponse

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

the class ManagerProcessContext method startGetConfigurationSetListener.

/**
 * Starts a request stream observer for {@link HostedManagerServiceGrpc} GetConfigurationSet
 * RPC calls.
 */
public void startGetConfigurationSetListener() {
    HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
    RequestStreamObserver requestObserver = new RequestStreamObserver<GetConfigurationSetRequest, GetConfigurationSetResponse>() {

        @Override
        public GetConfigurationSetResponse exec(GetConfigurationSetRequest req) {
            AlluxioConfigurationSet confSet = configurationSetFor(req.getPayload().getNodeType());
            return GetConfigurationSetResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(GetConfigurationSetResponse.Payload.newBuilder().setConfSet(confSet).build()).build();
        }

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

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

Aggregations

RequestStreamObserver (alluxio.hub.manager.rpc.observer.RequestStreamObserver)1 AgentGetConfigurationSetRequest (alluxio.hub.proto.AgentGetConfigurationSetRequest)1 AlluxioConfigurationSet (alluxio.hub.proto.AlluxioConfigurationSet)1 GetConfigurationSetRequest (alluxio.hub.proto.GetConfigurationSetRequest)1 GetConfigurationSetResponse (alluxio.hub.proto.GetConfigurationSetResponse)1 HostedManagerServiceGrpc (alluxio.hub.proto.HostedManagerServiceGrpc)1 ByteString (com.google.protobuf.ByteString)1