Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 58000200D1E for ; Wed, 4 Oct 2017 03:49:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 569B71609DE; Wed, 4 Oct 2017 01:49:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 98327160BDE for ; Wed, 4 Oct 2017 03:49:46 +0200 (CEST) Received: (qmail 49914 invoked by uid 500); 4 Oct 2017 01:49:45 -0000 Mailing-List: contact commits-help@helix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@helix.apache.org Delivered-To: mailing list commits@helix.apache.org Received: (qmail 49684 invoked by uid 99); 4 Oct 2017 01:49:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Oct 2017 01:49:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EF851F5C4C; Wed, 4 Oct 2017 01:49:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jxue@apache.org To: commits@helix.apache.org Date: Wed, 04 Oct 2017 01:49:47 -0000 Message-Id: <5cdb6e14559044338e41064479e797ad@git.apache.org> In-Reply-To: <69c1d8a4214044698d5f845da106d27b@git.apache.org> References: <69c1d8a4214044698d5f845da106d27b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [6/7] helix git commit: Config to change the interval of healthReport collection archived-at: Wed, 04 Oct 2017 01:49:47 -0000 Config to change the interval of healthReport collection To better support the health report, the configurable collection time interval is necessary. Add this configuration in system environment since there is no zookeeper connection happens before create healthreport tasks. Project: http://git-wip-us.apache.org/repos/asf/helix/repo Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/bd113a18 Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/bd113a18 Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/bd113a18 Branch: refs/heads/master Commit: bd113a181a25611b7e2581f0bcbbce24d4aab1eb Parents: 177d5bd Author: Junkai Xue Authored: Tue Oct 3 15:22:47 2017 -0700 Committer: Junkai Xue Committed: Tue Oct 3 15:22:47 2017 -0700 ---------------------------------------------------------------------- .../helix/healthcheck/ParticipantHealthReportTask.java | 9 ++++++++- .../java/org/apache/helix/manager/zk/ZKHelixManager.java | 9 +++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/helix/blob/bd113a18/helix-core/src/main/java/org/apache/helix/healthcheck/ParticipantHealthReportTask.java ---------------------------------------------------------------------- diff --git a/helix-core/src/main/java/org/apache/helix/healthcheck/ParticipantHealthReportTask.java b/helix-core/src/main/java/org/apache/helix/healthcheck/ParticipantHealthReportTask.java index f1c4c24..e0f38ba 100644 --- a/helix-core/src/main/java/org/apache/helix/healthcheck/ParticipantHealthReportTask.java +++ b/helix-core/src/main/java/org/apache/helix/healthcheck/ParticipantHealthReportTask.java @@ -29,6 +29,7 @@ import org.apache.log4j.Logger; public class ParticipantHealthReportTask extends HelixTimerTask { private static final Logger LOG = Logger.getLogger(ParticipantHealthReportTask.class); public final static int DEFAULT_REPORT_LATENCY = 60 * 1000; + private final int _reportLatency; Timer _timer; final ParticipantHealthReportCollectorImpl _healthReportCollector; @@ -42,7 +43,13 @@ public class ParticipantHealthReportTask extends HelixTimerTask { } public ParticipantHealthReportTask(ParticipantHealthReportCollectorImpl healthReportCollector) { + this(healthReportCollector, DEFAULT_REPORT_LATENCY); + } + + public ParticipantHealthReportTask(ParticipantHealthReportCollectorImpl healthReportCollector, + int reportLatency) { _healthReportCollector = healthReportCollector; + _reportLatency = reportLatency; } @Override @@ -51,7 +58,7 @@ public class ParticipantHealthReportTask extends HelixTimerTask { LOG.info("Start HealthCheckInfoReportingTask"); _timer = new Timer("ParticipantHealthReportTimerTask", true); _timer.scheduleAtFixedRate(new ParticipantHealthReportTimerTask(), - new Random().nextInt(DEFAULT_REPORT_LATENCY), DEFAULT_REPORT_LATENCY); + new Random().nextInt(_reportLatency), _reportLatency); } else { LOG.warn("ParticipantHealthReportTimerTask already started"); } http://git-wip-us.apache.org/repos/asf/helix/blob/bd113a18/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 670a65e..fdc6a55 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 @@ -100,6 +100,7 @@ public class ZKHelixManager implements HelixManager, IZkStateListener { * helix version# */ private final String _version; + private int _reportLatency; protected ZkClient _zkclient = null; private final DefaultMessagingService _messagingService; @@ -231,6 +232,8 @@ public class ZKHelixManager implements HelixManager, IZkStateListener { _connectionRetryTimeout = getSystemPropertyAsInt("zk.connectionReEstablishment.timeout", DEFAULT_CONNECTION_ESTABLISHMENT_RETRY_TIMEOUT); + _reportLatency = getSystemPropertyAsInt("helixmanager.participantHealthReport.reportLatency", + ParticipantHealthReportTask.DEFAULT_REPORT_LATENCY); /** * instance type specific init @@ -240,7 +243,8 @@ public class ZKHelixManager implements HelixManager, IZkStateListener { _stateMachineEngine = new HelixStateMachineEngine(this); _participantHealthInfoCollector = new ParticipantHealthReportCollectorImpl(this, _instanceName); - _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector)); + _timerTasks + .add(new ParticipantHealthReportTask(_participantHealthInfoCollector, _reportLatency)); break; case CONTROLLER: _stateMachineEngine = null; @@ -253,7 +257,8 @@ public class ZKHelixManager implements HelixManager, IZkStateListener { _participantHealthInfoCollector = new ParticipantHealthReportCollectorImpl(this, _instanceName); - _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector)); + _timerTasks + .add(new ParticipantHealthReportTask(_participantHealthInfoCollector, _reportLatency)); _controllerTimerTasks.add(new StatusDumpTask(this)); break; case ADMINISTRATOR: