|
@@ -61,6 +61,9 @@ public class PackageHandler {
|
|
|
@Value("${system.data-file.tsdb-writer-thread-num}")
|
|
|
private int tsdbWriterThreadNum;
|
|
|
|
|
|
+ @Value("${debug.justReceivePacket}")
|
|
|
+ private Boolean isJustReceivePacket;
|
|
|
+
|
|
|
private long bufferIndex = 0;
|
|
|
private SpentTimeCalculator bufferFullTimeCalculator = SpentTimeCalculator.create().begin();
|
|
|
|
|
@@ -216,18 +219,21 @@ public class PackageHandler {
|
|
|
log.debug("开始处理探针上传的数据包:{}", dataResponsePackage);
|
|
|
statisticService.incrDataCount();
|
|
|
|
|
|
- if (enableWal) { // 生成 WAL 文件
|
|
|
- WalItem walItem = new WalItem(dataResponsePackage.getProbeId(), dataResponsePackage.getPort(),
|
|
|
- dataResponsePackage.getDataStrategy(), dataResponsePackage.getClockSync(),
|
|
|
- dataResponsePackage.getTimestamp(), dataResponsePackage.getRawPacket());
|
|
|
+ if(isJustReceivePacket) {
|
|
|
|
|
|
- try {
|
|
|
- walFileService.appendWal(walItem);
|
|
|
- } catch (IOException e) {
|
|
|
- log.error("添加walItem到wal文件失败,walItem:{}", walItem, e);
|
|
|
+ if (enableWal) { // 生成 WAL 文件
|
|
|
+ WalItem walItem = new WalItem(dataResponsePackage.getProbeId(), dataResponsePackage.getPort(),
|
|
|
+ dataResponsePackage.getDataStrategy(), dataResponsePackage.getClockSync(),
|
|
|
+ dataResponsePackage.getTimestamp(), dataResponsePackage.getRawPacket());
|
|
|
+
|
|
|
+ try {
|
|
|
+ walFileService.appendWal(walItem);
|
|
|
+ } catch (IOException e) {
|
|
|
+ log.error("添加walItem到wal文件失败,walItem:{}", walItem, e);
|
|
|
+ }
|
|
|
}
|
|
|
+ addToPackageBuffer(dataResponsePackage);
|
|
|
}
|
|
|
- addToPackageBuffer(dataResponsePackage);
|
|
|
}
|
|
|
|
|
|
/**
|