Github user JPercivall commented on a diff in the pull request:
https://github.com/apache/nifi/pull/575#discussion_r70645469
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MonitorActivity.java
---
@@ -168,17 +216,49 @@ public void onTrigger(final ProcessContext context,
final ProcessSession session
final long now = System.currentTimeMillis();
final ComponentLog logger = getLogger();
+ final String monitoringScope =
context.getProperty(MONITORING_SCOPE).getValue();
+ final boolean copyAttributes =
context.getProperty(COPY_ATTRIBUTES).asBoolean();
+ final boolean isClusterScope =
SCOPE_CLUSTER.equals(monitoringScope);
final List<FlowFile> flowFiles = session.get(50);
+
+ boolean isInactive = false;
+ long updatedLatestSuccessTransfer = -1;
+ StateMap clusterState = null;
+ final boolean shouldThisNodeReport = !isClusterScope
--- End diff --
I like the change to add the ability to report on the primary node or all.
That said, this check should probably be moved to a function that is used
before each time it would report. Since the primary node change could happen at
any time this function should wait to do the check to try and prevent two nodes
from each sending a message.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---