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