From 287fab63465f88553f909d0c7b8a9bc612ce0e77 Mon Sep 17 00:00:00 2001 From: Fei Hui Date: Fri, 25 Oct 2019 15:05:31 -0700 Subject: [PATCH] HDFS-14923. Remove dead code from HealthMonitor. Contributed by Fei Hui. Signed-off-by: Wei-Chiu Chuang (cherry picked from commit 7be5508d9b35892f483ba6022b6aced7648b8fa3) (cherry picked from commit 54d3e212bfdcc6b473969a70faca339184849e61) --- .../java/org/apache/hadoop/ha/HealthMonitor.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java index d1a858fd85f..5f2c806810b 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HealthMonitor.java @@ -134,19 +134,11 @@ public class HealthMonitor { public void addCallback(Callback cb) { this.callbacks.add(cb); } - - public void removeCallback(Callback cb) { - callbacks.remove(cb); - } public synchronized void addServiceStateCallback(ServiceStateCallback cb) { this.serviceStateCallbacks.add(cb); } - public synchronized void removeServiceStateCallback(ServiceStateCallback cb) { - serviceStateCallbacks.remove(cb); - } - public void shutdown() { LOG.info("Stopping HealthMonitor thread"); shouldRun = false; @@ -258,11 +250,7 @@ public class HealthMonitor { synchronized State getHealthState() { return state; } - - synchronized HAServiceStatus getLastServiceStatus() { - return lastServiceState; - } - + boolean isAlive() { return daemon.isAlive(); }