You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by hu...@apache.org on 2018/06/19 07:38:27 UTC
[incubator-heron] branch huijunw/togglepolicy updated: fix compile
This is an automated email from the ASF dual-hosted git repository.
huijun pushed a commit to branch huijunw/togglepolicy
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
The following commit(s) were added to refs/heads/huijunw/togglepolicy by this push:
new 51c6b48 fix compile
51c6b48 is described below
commit 51c6b48c955656181507e0d7800610b75d2ef297
Author: Huijun Wu <hu...@twitter.com>
AuthorDate: Tue Jun 19 00:38:01 2018 -0700
fix compile
---
.../heron/healthmgr/policy/ToggleablePolicy.java | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/heron/healthmgr/src/java/org/apache/heron/healthmgr/policy/ToggleablePolicy.java b/heron/healthmgr/src/java/org/apache/heron/healthmgr/policy/ToggleablePolicy.java
index 013812e..6dbb363 100644
--- a/heron/healthmgr/src/java/org/apache/heron/healthmgr/policy/ToggleablePolicy.java
+++ b/heron/healthmgr/src/java/org/apache/heron/healthmgr/policy/ToggleablePolicy.java
@@ -57,18 +57,12 @@ public class ToggleablePolicy extends HealthPolicyImpl {
LOG.info("kv " + kv.getKey() + " => " + kv.getValue());
if (kv.getKey().equals(TOGGLE_RUNTIME_CONFIG_KEY)) {
Boolean b = Boolean.parseBoolean(kv.getValue());
- if (Boolean.FALSE.equals(b)) {
- if (running) {
- running = false;
- LOG.info("policy running status changed to False");
- }
- } else if (Boolean.TRUE.equals(b)) {
- if (!running) {
- running = true;
- LOG.info("policy running status changed to True");
- }
- } else {
- LOG.warning("unknown runtime config for `policy running status`: " + val);
+ if (Boolean.FALSE.equals(b) && running) {
+ running = false;
+ LOG.info("policy running status changed to False");
+ } else if (Boolean.TRUE.equals(b) && !running) {
+ running = true;
+ LOG.info("policy running status changed to True");
}
}
}