HIVE-21575 : memstore above high watermark message is logged too much
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4640ff59 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4640ff59 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4640ff59 Branch: refs/heads/HBASE-21512 Commit: 4640ff5959af4865966126a503a7cd15e26a7408 Parents: 67d6d50 Author: Sergey Shelukhin <ser...@apache.org> Authored: Wed Dec 12 11:02:25 2018 -0800 Committer: Sergey Shelukhin <ser...@apache.org> Committed: Wed Dec 12 11:02:25 2018 -0800 ---------------------------------------------------------------------- .../apache/hadoop/hbase/regionserver/MemStoreFlusher.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/4640ff59/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java index 699c9b6..804a2f8 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java @@ -703,6 +703,7 @@ class MemStoreFlusher implements FlushRequester { if (flushType != FlushType.NORMAL) { TraceUtil.addTimelineAnnotation("Force Flush. We're above high water mark."); long start = EnvironmentEdgeManager.currentTime(); + long nextLogTimeMs = start; synchronized (this.blockSignal) { boolean blocked = false; long startTime = 0; @@ -744,8 +745,11 @@ class MemStoreFlusher implements FlushRequester { LOG.warn("Interrupted while waiting"); interrupted = true; } - long took = EnvironmentEdgeManager.currentTime() - start; - LOG.warn("Memstore is above high water mark and block " + took + "ms"); + long nowMs = EnvironmentEdgeManager.currentTime(); + if (nowMs >= nextLogTimeMs) { + LOG.warn("Memstore is above high water mark and block {} ms", nowMs - start); + nextLogTimeMs = nowMs + 1000; + } flushType = isAboveHighWaterMark(); } } finally {