RPC的服务端埋点的Column加上S

This commit is contained in:
zhangxin10 2015-11-18 22:05:39 +08:00
parent 6a2c197be4
commit b8045d0d50
1 changed files with 12 additions and 3 deletions

View File

@ -98,14 +98,23 @@ public class SaveToHBaseChain implements IStorageChain {
return;
List<Put> puts = new ArrayList<Put>();
Put put;
String columnName;
for (BuriedPointEntry buriedPointEntry : entries) {
put = new Put(Bytes.toBytes(buriedPointEntry.getTraceId()));
if (StringUtils.isEmpty(buriedPointEntry.getParentLevel().trim())) {
put.addColumn(Bytes.toBytes(Config.HBaseConfig.FAMILY_COLUMN_NAME), Bytes.toBytes(String.valueOf(buriedPointEntry.getLevelId())),
columnName = buriedPointEntry.getLevelId() + "";
if (buriedPointEntry.isReceiver()) {
columnName = buriedPointEntry.getLevelId() + "-S";
}
put.addColumn(Bytes.toBytes(Config.HBaseConfig.FAMILY_COLUMN_NAME), Bytes.toBytes(columnName),
Bytes.toBytes(buriedPointEntry.getOriginData()));
} else {
put.addColumn(Bytes.toBytes(Config.HBaseConfig.FAMILY_COLUMN_NAME), Bytes.toBytes(buriedPointEntry.getParentLevel()
+ "." + buriedPointEntry.getLevelId()), Bytes.toBytes(buriedPointEntry.getOriginData()));
columnName = buriedPointEntry.getParentLevel() + "." + buriedPointEntry.getLevelId();
if (buriedPointEntry.isReceiver()) {
columnName = buriedPointEntry.getLevelId() + "-S";
}
put.addColumn(Bytes.toBytes(Config.HBaseConfig.FAMILY_COLUMN_NAME), Bytes.toBytes(columnName),
Bytes.toBytes(buriedPointEntry.getOriginData()));
}
puts.add(put);
}