use of io.grpc.channelz.v1.GetTopChannelsResponse in project grpc-java by grpc.
the class ChannelzService method getTopChannels.
/**
* Returns top level channel aka {@link io.grpc.ManagedChannel}.
*/
@Override
public void getTopChannels(GetTopChannelsRequest request, StreamObserver<GetTopChannelsResponse> responseObserver) {
InternalChannelz.RootChannelList rootChannels = channelz.getRootChannels(request.getStartChannelId(), maxPageSize);
GetTopChannelsResponse resp;
try {
resp = ChannelzProtoUtil.toGetTopChannelResponse(rootChannels);
} catch (StatusRuntimeException e) {
responseObserver.onError(e);
return;
}
responseObserver.onNext(resp);
responseObserver.onCompleted();
}
Aggregations