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