Search in sources :

Example 1 with SpanReceiverListInfo

use of org.apache.hadoop.tracing.TraceAdminPB.SpanReceiverListInfo 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()]);
}
Also used : ServiceException(com.google.protobuf.ServiceException) ArrayList(java.util.ArrayList) SpanReceiverListInfo(org.apache.hadoop.tracing.TraceAdminPB.SpanReceiverListInfo) ListSpanReceiversRequestProto(org.apache.hadoop.tracing.TraceAdminPB.ListSpanReceiversRequestProto) ListSpanReceiversResponseProto(org.apache.hadoop.tracing.TraceAdminPB.ListSpanReceiversResponseProto)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 ArrayList (java.util.ArrayList)1 ListSpanReceiversRequestProto (org.apache.hadoop.tracing.TraceAdminPB.ListSpanReceiversRequestProto)1 ListSpanReceiversResponseProto (org.apache.hadoop.tracing.TraceAdminPB.ListSpanReceiversResponseProto)1 SpanReceiverListInfo (org.apache.hadoop.tracing.TraceAdminPB.SpanReceiverListInfo)1