更改连接字符
This commit is contained in:
parent
b3abd507bd
commit
eafb0b80a4
|
|
@ -2,5 +2,5 @@ package com.ai.cloud.skywalking.constants;
|
|||
|
||||
public class Constants {
|
||||
|
||||
public static final String spiltRegx = "^|@|#";
|
||||
public static final String spiltRegx = "^~";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
package com.ai.cloud.skywalking.reciever.constants;
|
||||
|
||||
public class Constants {
|
||||
public static final String spiltRegx = "\\^\\|@\\|#";
|
||||
public static final String spiltRegx = "\\^\\~";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ package com.ai.cloud.skywalking.reciever.model;
|
|||
|
||||
import com.ai.cloud.skywalking.reciever.constants.Constants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class BuriedPointEntry {
|
||||
private String traceId;
|
||||
|
|
@ -105,6 +107,26 @@ public class BuriedPointEntry {
|
|||
return result;
|
||||
}
|
||||
|
||||
private static String[] spilt(String spilt, String value) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
int resultSize = 0;
|
||||
int start = 0, offset = 0;
|
||||
for (int index = 0; index < value.length() - 1; index++, offset++) {
|
||||
if (spilt.charAt(0) == value.charAt(index) && spilt.charAt(1) == value.charAt(index + 1)) {
|
||||
list.add(value.substring(start, offset));
|
||||
index++;offset++;
|
||||
start = offset + 1;
|
||||
resultSize++;
|
||||
}
|
||||
}
|
||||
if (start < value.length()) {
|
||||
list.add(value.substring(start, offset));
|
||||
resultSize++;
|
||||
}
|
||||
String[] result = new String[resultSize];
|
||||
return list.subList(0, resultSize).toArray(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BuriedPointEntry{" +
|
||||
|
|
|
|||
|
|
@ -94,12 +94,14 @@ public class SaveToHBaseChain implements IStorageChain {
|
|||
|
||||
|
||||
private static void bulkInsertBuriedPointData(List<BuriedPointEntry> entries) {
|
||||
if (entries == null || entries.size() <= 0)
|
||||
return;
|
||||
List<Put> puts = new ArrayList<Put>();
|
||||
Put put;
|
||||
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(buriedPointEntry.getLevelId()),
|
||||
put.addColumn(Bytes.toBytes(Config.HBaseConfig.FAMILY_COLUMN_NAME), Bytes.toBytes(String.valueOf(buriedPointEntry.getLevelId())),
|
||||
Bytes.toBytes(buriedPointEntry.getOriginData()));
|
||||
} else {
|
||||
put.addColumn(Bytes.toBytes(Config.HBaseConfig.FAMILY_COLUMN_NAME), Bytes.toBytes(buriedPointEntry.getParentLevel()
|
||||
|
|
|
|||
Loading…
Reference in New Issue