Change error record dump threshold to 100, and remove log if there is no paths to dump.
Project: http://git-wip-us.apache.org/repos/asf/helix/repo Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/9b9da195 Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/9b9da195 Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/9b9da195 Branch: refs/heads/master Commit: 9b9da195412b2dccc8414d7cd6f804414f527cff Parents: 1f7417a Author: Lei Xia <[email protected]> Authored: Wed Dec 13 14:42:00 2017 -0800 Committer: Junkai Xue <[email protected]> Committed: Wed Jan 24 18:32:29 2018 -0800 ---------------------------------------------------------------------- .../apache/helix/manager/zk/ZKHelixManager.java | 2 +- .../helix/monitoring/ZKPathDataDumpTask.java | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/helix/blob/9b9da195/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java ---------------------------------------------------------------------- diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java b/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java index 60b9a3f..dee9adf 100644 --- a/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java +++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java @@ -145,7 +145,7 @@ public class ZKHelixManager implements HelixManager, IZkStateListener { long period = 15 * 60 * 1000; long timeThresholdNoChangeForStatusUpdates = 15 * 60 * 1000; // 15 minutes long timeThresholdNoChangeForErrors = 24 * 60 * 60 * 1000; // 1 day - int maximumNumberOfLeafNodesAllowed = 10000; + int maximumNumberOfLeafNodesAllowed = 100; if (_timer == null) { LOG.info("Start StatusDumpTask"); http://git-wip-us.apache.org/repos/asf/helix/blob/9b9da195/helix-core/src/main/java/org/apache/helix/monitoring/ZKPathDataDumpTask.java ---------------------------------------------------------------------- diff --git a/helix-core/src/main/java/org/apache/helix/monitoring/ZKPathDataDumpTask.java b/helix-core/src/main/java/org/apache/helix/monitoring/ZKPathDataDumpTask.java index 1b723d9..0b70e41 100644 --- a/helix-core/src/main/java/org/apache/helix/monitoring/ZKPathDataDumpTask.java +++ b/helix-core/src/main/java/org/apache/helix/monitoring/ZKPathDataDumpTask.java @@ -138,16 +138,18 @@ public class ZKPathDataDumpTask extends TimerTask { } } - // dump - LOG.info("Dump statusUpdates and errors records for pahts: " + dumpPaths); - List<ZNRecord> dumpRecords = accessor.get(dumpPaths, null, 0); - for (ZNRecord record : dumpRecords) { - if (record != null) { - LOG.info(new String(_jsonSerializer.serialize(record))); + if (!dumpPaths.isEmpty()) { + LOG.info("Dump statusUpdates and errors records for paths: " + dumpPaths); + List<ZNRecord> dumpRecords = accessor.get(dumpPaths, null, 0); + for (ZNRecord record : dumpRecords) { + if (record != null) { + LOG.info(new String(_jsonSerializer.serialize(record))); + } } - } - // clean up - accessor.remove(dumpPaths, 0); + // clean up + accessor.remove(dumpPaths, 0); + LOG.info("Remove statusUpdates and errors records for paths: " + dumpPaths); + } } }
