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