use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping in project incubator-skywalking by apache.
the class InstanceMappingSpanListener method parseEntry.
@Override
public void parseEntry(SpanDecorator spanDecorator, int applicationId, int instanceId, String segmentId) {
logger.debug("instance mapping listener parse reference");
if (spanDecorator.getRefsCount() > 0) {
for (int i = 0; i < spanDecorator.getRefsCount(); i++) {
InstanceMapping instanceMapping = new InstanceMapping();
instanceMapping.setApplicationId(applicationId);
instanceMapping.setInstanceId(instanceId);
instanceMapping.setAddressId(spanDecorator.getRefs(i).getNetworkAddressId());
String metricId = String.valueOf(instanceId) + Const.ID_SPLIT + String.valueOf(instanceMapping.getAddressId());
instanceMapping.setMetricId(metricId);
instanceMappings.add(instanceMapping);
}
}
}
use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping in project incubator-skywalking by apache.
the class InstanceMappingCopy method copy.
public static InstanceMapping copy(InstanceMapping instanceMapping) {
InstanceMapping newInstanceMapping = new InstanceMapping();
newInstanceMapping.setId(instanceMapping.getId());
newInstanceMapping.setMetricId(instanceMapping.getMetricId());
newInstanceMapping.setApplicationId(instanceMapping.getApplicationId());
newInstanceMapping.setInstanceId(instanceMapping.getInstanceId());
newInstanceMapping.setAddressId(instanceMapping.getAddressId());
newInstanceMapping.setTimeBucket(instanceMapping.getTimeBucket());
return newInstanceMapping;
}
use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceMapping in project incubator-skywalking by apache.
the class AbstractInstanceMappingH2PersistenceDAO method h2DataToStreamData.
@Override
protected final InstanceMapping h2DataToStreamData(ResultSet resultSet) throws SQLException {
InstanceMapping instanceMapping = new InstanceMapping();
instanceMapping.setId(resultSet.getString(InstanceMappingTable.COLUMN_ID));
instanceMapping.setMetricId(resultSet.getString(InstanceMappingTable.COLUMN_METRIC_ID));
instanceMapping.setApplicationId(resultSet.getInt(InstanceMappingTable.COLUMN_APPLICATION_ID));
instanceMapping.setInstanceId(resultSet.getInt(InstanceMappingTable.COLUMN_INSTANCE_ID));
instanceMapping.setAddressId(resultSet.getInt(InstanceMappingTable.COLUMN_ADDRESS_ID));
instanceMapping.setTimeBucket(resultSet.getLong(InstanceMappingTable.COLUMN_TIME_BUCKET));
return instanceMapping;
}
Aggregations