use of org.apache.hadoop.tracing.TraceAdminPB.ListSpanReceiversResponseProto in project hadoop by apache.
the class TraceAdminProtocolTranslatorPB method listSpanReceivers.
@Override
public SpanReceiverInfo[] listSpanReceivers() throws IOException {
ArrayList<SpanReceiverInfo> infos = new ArrayList<SpanReceiverInfo>(1);
try {
ListSpanReceiversRequestProto req = ListSpanReceiversRequestProto.newBuilder().build();
ListSpanReceiversResponseProto resp = rpcProxy.listSpanReceivers(null, req);
for (SpanReceiverListInfo info : resp.getDescriptionsList()) {
infos.add(new SpanReceiverInfo(info.getId(), info.getClassName()));
}
} catch (ServiceException e) {
throw ProtobufHelper.getRemoteException(e);
}
return infos.toArray(new SpanReceiverInfo[infos.size()]);
}
use of org.apache.hadoop.tracing.TraceAdminPB.ListSpanReceiversResponseProto in project hadoop by apache.
the class TraceAdminProtocolServerSideTranslatorPB method listSpanReceivers.
@Override
public ListSpanReceiversResponseProto listSpanReceivers(RpcController controller, ListSpanReceiversRequestProto req) throws ServiceException {
try {
SpanReceiverInfo[] descs = server.listSpanReceivers();
ListSpanReceiversResponseProto.Builder bld = ListSpanReceiversResponseProto.newBuilder();
for (int i = 0; i < descs.length; ++i) {
bld.addDescriptions(TraceAdminPB.SpanReceiverListInfo.newBuilder().setId(descs[i].getId()).setClassName(descs[i].getClassName()).build());
}
return bld.build();
} catch (IOException e) {
throw new ServiceException(e);
}
}
Aggregations