From ded396f0ef2c090456a532f2ce427525c8a1a4b6 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Mon, 22 May 2017 15:28:30 -0400 Subject: [PATCH] NIFI-3933: - When monitoring heartbeats use the connected nodes as the basis for the check. This addresses the case when a node is terminated and no corresponding heartbeats exist. This closes #1838. --- .../cluster/coordination/heartbeat/HeartbeatMonitor.java | 7 ------- .../coordination/heartbeat/AbstractHeartbeatMonitor.java | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/HeartbeatMonitor.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/HeartbeatMonitor.java index 3cc5fd0ca4..6a0937d99c 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/HeartbeatMonitor.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/HeartbeatMonitor.java @@ -58,13 +58,6 @@ public interface HeartbeatMonitor { */ void purgeHeartbeats(); - /** - * Returns when the heartbeats were purged last. - * - * @return when the heartbeats were purged last - */ - long getPurgeTimestamp(); - /** * @return the address that heartbeats should be sent to when this node is elected coordinator. */ diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/AbstractHeartbeatMonitor.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/AbstractHeartbeatMonitor.java index c5d9e4bc6c..4c251f9fdf 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/AbstractHeartbeatMonitor.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/AbstractHeartbeatMonitor.java @@ -281,6 +281,13 @@ public abstract class AbstractHeartbeatMonitor implements HeartbeatMonitor { */ protected abstract Map getLatestHeartbeats(); + /** + * Returns when the heartbeats were purged last. + * + * @return when the heartbeats were purged last + */ + protected abstract long getPurgeTimestamp(); + /** * This method does nothing in the abstract class but is meant for * subclasses to override in order to provide functionality when the monitor