use of com.navercorp.pinpoint.common.server.bo.ServerMetaDataBo in project pinpoint by naver.
the class HbaseAgentInfoDao method insert.
@Override
public void insert(TAgentInfo agentInfo) {
if (agentInfo == null) {
throw new NullPointerException("agentInfo must not be null");
}
if (logger.isDebugEnabled()) {
logger.debug("insert agent info. {}", agentInfo);
}
byte[] agentId = Bytes.toBytes(agentInfo.getAgentId());
long reverseKey = TimeUtils.reverseTimeMillis(agentInfo.getStartTimestamp());
byte[] rowKey = RowKeyUtils.concatFixedByteAndLong(agentId, HBaseTables.AGENT_NAME_MAX_LEN, reverseKey);
Put put = new Put(rowKey);
// should add additional agent informations. for now added only starttime for sqlMetaData
AgentInfoBo agentInfoBo = this.agentInfoBoMapper.map(agentInfo);
byte[] agentInfoBoValue = agentInfoBo.writeValue();
put.addColumn(HBaseTables.AGENTINFO_CF_INFO, HBaseTables.AGENTINFO_CF_INFO_IDENTIFIER, agentInfoBoValue);
if (agentInfo.isSetServerMetaData()) {
ServerMetaDataBo serverMetaDataBo = this.serverMetaDataBoMapper.map(agentInfo.getServerMetaData());
byte[] serverMetaDataBoValue = serverMetaDataBo.writeValue();
put.addColumn(HBaseTables.AGENTINFO_CF_INFO, HBaseTables.AGENTINFO_CF_INFO_SERVER_META_DATA, serverMetaDataBoValue);
}
if (agentInfo.isSetJvmInfo()) {
JvmInfoBo jvmInfoBo = this.jvmInfoBoMapper.map(agentInfo.getJvmInfo());
byte[] jvmInfoBoValue = jvmInfoBo.writeValue();
put.addColumn(HBaseTables.AGENTINFO_CF_INFO, HBaseTables.AGENTINFO_CF_INFO_JVM, jvmInfoBoValue);
}
hbaseTemplate.put(HBaseTables.AGENTINFO, put);
}
use of com.navercorp.pinpoint.common.server.bo.ServerMetaDataBo 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();
}
}
use of com.navercorp.pinpoint.common.server.bo.ServerMetaDataBo in project pinpoint by naver.
the class GrpcServerMetaDataBoMapper method map.
public ServerMetaDataBo map(final PServerMetaData serverMetaData) {
final String serverInfo = serverMetaData.getServerInfo();
final List<String> vmArgs = serverMetaData.getVmArgList();
final ServerMetaDataBo.Builder builder = new ServerMetaDataBo.Builder();
builder.serverInfo(serverInfo);
builder.vmArgs(vmArgs);
final List<PServiceInfo> serviceInfoList = serverMetaData.getServiceInfoList();
if (CollectionUtils.hasLength(serviceInfoList)) {
final List<ServiceInfoBo> serviceInfoBoList = new ArrayList<>(serverMetaData.getServiceInfoCount());
for (PServiceInfo tServiceInfo : serviceInfoList) {
final ServiceInfoBo serviceInfoBo = mapServiceInfo(tServiceInfo);
serviceInfoBoList.add(serviceInfoBo);
}
builder.serviceInfos(serviceInfoBoList);
return builder.build();
} else {
builder.serviceInfos(Collections.emptyList());
return builder.build();
}
}
use of com.navercorp.pinpoint.common.server.bo.ServerMetaDataBo in project pinpoint by naver.
the class ThriftServerMetaDataBoMapper 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.emptyList());
return builder.build();
}
}
Aggregations