File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
iotdb-core/datanode/src/main/java/org/apache/iotdb/db Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,12 @@ private void bindWALMetrics(AbstractMetricService metricService) {
257257 MetricLevel .IMPORTANT ,
258258 Tag .NAME .toString (),
259259 WRITE_WAL_BUFFER_COST_NS );
260+ walQueueMaxMemSizeGauge =
261+ metricService .getOrCreateGauge (
262+ Metric .WAL_QUEUE_MEM_COST .toString (),
263+ MetricLevel .IMPORTANT ,
264+ Tag .NAME .toString (),
265+ WAL_QUEUE_MAX_MEM_COST );
260266 SystemInfo systemInfo = SystemInfo .getInstance ();
261267 metricService .createAutoGauge (
262268 Metric .WAL_QUEUE_MEM_COST .toString (),
@@ -265,12 +271,6 @@ private void bindWALMetrics(AbstractMetricService metricService) {
265271 SystemInfo ::getCurrentWalQueueMemoryCost ,
266272 Tag .NAME .toString (),
267273 WAL_QUEUE_CURRENT_MEM_COST );
268- walQueueMaxMemSizeGauge =
269- metricService .getOrCreateGauge (
270- Metric .WAL_QUEUE_MEM_COST .toString (),
271- MetricLevel .IMPORTANT ,
272- Tag .NAME .toString (),
273- WAL_QUEUE_MAX_MEM_COST );
274274 }
275275
276276 private void unbindWALMetrics (AbstractMetricService metricService ) {
Original file line number Diff line number Diff line change 2929public class MemoryControlledWALEntryQueue {
3030
3131 private final BlockingQueue <WALEntry > queue ;
32- private final Object nonFullCondition = new Object ();
32+ private static final Object nonFullCondition = new Object ();
3333
3434 public MemoryControlledWALEntryQueue () {
3535 queue = new LinkedBlockingQueue <>();
Original file line number Diff line number Diff line change @@ -532,6 +532,7 @@ public synchronized void applyTemporaryMemoryForFlushing(long estimatedTemporary
532532 REJECT_THRESHOLD = memorySizeForMemtable * config .getRejectProportion ();
533533 WritingMetrics .getInstance ().recordFlushThreshold (FLUSH_THRESHOLD );
534534 WritingMetrics .getInstance ().recordRejectThreshold (REJECT_THRESHOLD );
535+ WritingMetrics .getInstance ().recordWALQueueMaxMemorySize (memorySizeForWalBufferQueue );
535536 }
536537
537538 public synchronized void releaseTemporaryMemoryForFlushing (long estimatedTemporaryMemSize ) {
@@ -540,6 +541,7 @@ public synchronized void releaseTemporaryMemoryForFlushing(long estimatedTempora
540541 REJECT_THRESHOLD = memorySizeForMemtable * config .getRejectProportion ();
541542 WritingMetrics .getInstance ().recordFlushThreshold (FLUSH_THRESHOLD );
542543 WritingMetrics .getInstance ().recordRejectThreshold (REJECT_THRESHOLD );
544+ WritingMetrics .getInstance ().recordWALQueueMaxMemorySize (memorySizeForWalBufferQueue );
543545 }
544546
545547 public long getTotalMemTableSize () {
You can’t perform that action at this time.
0 commit comments