use of alluxio.hub.proto.WriteConfigurationSetRequest in project alluxio by Alluxio.
the class ManagerProcessContext method startWriteConfigurationSetListener.
/**
* Starts a request stream observer for {@link HostedManagerServiceGrpc} WriteConfigurationSet
* RPC calls.
*/
public void startWriteConfigurationSetListener() {
HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
RequestStreamObserver requestObserver = new RequestStreamObserver<WriteConfigurationSetRequest, WriteConfigurationSetResponse>() {
@Override
public WriteConfigurationSetResponse exec(WriteConfigurationSetRequest req) {
Preconditions.checkArgument(req.hasPayload());
Preconditions.checkArgument(req.getPayload().hasConfSet());
Preconditions.checkArgument(req.getPayload().getNodeTypeCount() > 0);
req.getPayload().getNodeTypeList().forEach(nodeType -> updateConfigurationFor(nodeType, req.getPayload().getConfSet()));
return WriteConfigurationSetResponse.newBuilder().setHubMetadata(mHubMetadata).build();
}
@Override
public void restart() {
startWriteConfigurationSetListener();
}
@Override
public void handleError(String message, Throwable t) {
handleStatusRuntimeException(message, t);
}
};
StreamObserver<WriteConfigurationSetResponse> responseObserver = asyncStub.writeConfigurationSet(requestObserver);
requestObserver.start(responseObserver, WriteConfigurationSetResponse.newBuilder().setHubMetadata(mHubMetadata).build());
LOG.info("Started WriteConfigurationSet async listener", asyncStub);
}
Aggregations