Search in sources :

Example 1 with TServiceInfo

use of com.navercorp.pinpoint.thrift.dto.TServiceInfo in project pinpoint by naver.

the class ServerMetaDataBoMapper method map.

@Override
public ServerMetaDataBo map(TServerMetaData thriftObject) {
    final String serverInfo = thriftObject.getServerInfo();
    final List<String> vmArgs = thriftObject.getVmArgs();
    ServerMetaDataBo.Builder builder = new ServerMetaDataBo.Builder();
    builder.serverInfo(serverInfo);
    builder.vmArgs(vmArgs);
    if (thriftObject.isSetServiceInfos()) {
        final List<ServiceInfoBo> serviceInfos = new ArrayList<>(thriftObject.getServiceInfosSize());
        for (TServiceInfo tServiceInfo : thriftObject.getServiceInfos()) {
            final ServiceInfoBo serviceInfoBo = mapServiceInfo(tServiceInfo);
            serviceInfos.add(serviceInfoBo);
        }
        builder.serviceInfos(serviceInfos);
        return builder.build();
    } else {
        builder.serviceInfos(Collections.<ServiceInfoBo>emptyList());
        return builder.build();
    }
}
Also used : TServiceInfo(com.navercorp.pinpoint.thrift.dto.TServiceInfo) ArrayList(java.util.ArrayList) ServerMetaDataBo(com.navercorp.pinpoint.common.server.bo.ServerMetaDataBo) ServiceInfoBo(com.navercorp.pinpoint.common.server.bo.ServiceInfoBo)

Example 2 with TServiceInfo

use of com.navercorp.pinpoint.thrift.dto.TServiceInfo in project pinpoint by naver.

the class AgentInfoSender method createTServiceInfo.

private TServerMetaData createTServiceInfo() {
    TServerMetaData tServerMetaData = new TServerMetaData();
    tServerMetaData.setServerInfo(serverMetaData.getServerInfo());
    tServerMetaData.setVmArgs(serverMetaData.getVmArgs());
    List<TServiceInfo> tServiceInfos = new ArrayList<TServiceInfo>();
    for (ServiceInfo serviceInfo : serverMetaData.getServiceInfos()) {
        TServiceInfo tServiceInfo = new TServiceInfo();
        tServiceInfo.setServiceName(serviceInfo.getServiceName());
        tServiceInfo.setServiceLibs(serviceInfo.getServiceLibs());
        tServiceInfos.add(tServiceInfo);
    }
    tServerMetaData.setServiceInfos(tServiceInfos);
    return tServerMetaData;
}
Also used : ServiceInfo(com.navercorp.pinpoint.bootstrap.context.ServiceInfo) TServiceInfo(com.navercorp.pinpoint.thrift.dto.TServiceInfo) TServiceInfo(com.navercorp.pinpoint.thrift.dto.TServiceInfo) ArrayList(java.util.ArrayList) TServerMetaData(com.navercorp.pinpoint.thrift.dto.TServerMetaData)

Aggregations

TServiceInfo (com.navercorp.pinpoint.thrift.dto.TServiceInfo)2 ArrayList (java.util.ArrayList)2 ServiceInfo (com.navercorp.pinpoint.bootstrap.context.ServiceInfo)1 ServerMetaDataBo (com.navercorp.pinpoint.common.server.bo.ServerMetaDataBo)1 ServiceInfoBo (com.navercorp.pinpoint.common.server.bo.ServiceInfoBo)1 TServerMetaData (com.navercorp.pinpoint.thrift.dto.TServerMetaData)1