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