|
@@ -70,11 +70,11 @@ public class PackageHandler {
|
|
private DelayQueue<TsdbTask> tsdbTaskBuffer = new DelayQueue<>();
|
|
private DelayQueue<TsdbTask> tsdbTaskBuffer = new DelayQueue<>();
|
|
private DelayQueue<DiskTask> diskTaskBuffer = new DelayQueue<>();
|
|
private DelayQueue<DiskTask> diskTaskBuffer = new DelayQueue<>();
|
|
|
|
|
|
- // public void initBuffer() {
|
|
|
|
- // bufferIndex.set(0L);
|
|
|
|
- // bufferFullTimeCalculator.set(SpentTimeCalculator.create().begin());
|
|
|
|
- // packageBuffer.set(new ArrayList<>(Globals.MAX_LOG_ITEM));
|
|
|
|
- // }
|
|
|
|
|
|
+ public void initBuffer() {
|
|
|
|
+ bufferIndex.set(0L);
|
|
|
|
+ bufferFullTimeCalculator.set(SpentTimeCalculator.create().begin());
|
|
|
|
+ packageBuffer.set(new ArrayList<>(Globals.MAX_LOG_ITEM));
|
|
|
|
+ }
|
|
|
|
|
|
@Data
|
|
@Data
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
@@ -235,10 +235,10 @@ public class PackageHandler {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // if (bufferIndex.get() == null) {
|
|
|
|
- // log.info("初始化threadLocal");
|
|
|
|
- // // initBuffer();
|
|
|
|
- // }
|
|
|
|
|
|
+ if (bufferIndex.get() == null) {
|
|
|
|
+ log.info("初始化threadLocal");
|
|
|
|
+ initBuffer();
|
|
|
|
+ }
|
|
|
|
|
|
addToPackageBuffer(dataResponsePackage);
|
|
addToPackageBuffer(dataResponsePackage);
|
|
}
|
|
}
|