use of alluxio.hub.proto.DetectPrestoResponse in project alluxio by Alluxio.
the class ManagerProcessContext method startDetectPrestoListener.
/**
* Starts a request stream observer for {@link HostedManagerServiceGrpc} DetectPresto RPC calls.
*/
public void startDetectPrestoListener() {
HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
RequestStreamObserver requestObserver = new RequestStreamObserver<DetectPrestoRequest, DetectPrestoResponse>() {
@Override
public DetectPrestoResponse exec(DetectPrestoRequest req) {
return DetectPrestoResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(detectPresto(req)).build();
}
@Override
public void restart() {
startDetectPrestoListener();
}
@Override
public void handleError(String message, Throwable t) {
handleStatusRuntimeException(message, t);
}
};
StreamObserver<DetectPrestoResponse> responseObserver = asyncStub.detectPresto(requestObserver);
requestObserver.start(responseObserver, DetectPrestoResponse.newBuilder().setHubMetadata(mHubMetadata).build());
LOG.info("Started DetectPresto async listener", asyncStub);
}
Aggregations