use of alluxio.hub.proto.PrestoCatalogListingResult in project alluxio by Alluxio.
the class ManagerProcessContext method startListCatalogListener.
/**
* Starts a request stream observer for {@link HostedManagerServiceGrpc} ListCatalog RPC calls.
*/
public void startListCatalogListener() {
HostedManagerServiceGrpc.HostedManagerServiceStub asyncStub = getHostedAsyncStub();
RequestStreamObserver requestObserver = new RequestStreamObserver<ListCatalogRequest, ListCatalogResponse>() {
@Override
public ListCatalogResponse exec(ListCatalogRequest req) {
PrestoCatalogListingResult result = listCatalogs(getUpdatedProps(configurationSetFor(AlluxioNodeType.MASTER)).getString(PropertyKey.HUB_MANAGER_PRESTO_CONF_PATH));
return ListCatalogResponse.newBuilder().setHubMetadata(mHubMetadata).setPayload(ListCatalogResponse.Payload.newBuilder().addAllCatalog(result.getCatalogList())).build();
}
@Override
public void restart() {
startListCatalogListener();
}
@Override
public void handleError(String message, Throwable t) {
handleStatusRuntimeException(message, t);
}
};
StreamObserver<ListCatalogResponse> responseObserver = asyncStub.listCatalog(requestObserver);
requestObserver.start(responseObserver, ListCatalogResponse.newBuilder().setHubMetadata(mHubMetadata).build());
LOG.info("Started ListCatalog async listener", asyncStub);
}
Aggregations