nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bbe...@apache.org
Subject nifi git commit: NIFI-2535: Do not include properties that are unset in flow fingerprint. This allows a new property to be added to a processor without affecting the fingerprint, if the value is never set
Date Thu, 11 Aug 2016 14:44:44 GMT
Repository: nifi
Updated Branches:
  refs/heads/master 76a4a2c48 -> 25a2fac45


NIFI-2535: Do not include properties that are unset in flow fingerprint. This allows a new
property to be added to a processor without affecting the fingerprint, if the value is never
set

This closes #829.

Signed-off-by: Bryan Bende <bbende@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/25a2fac4
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/25a2fac4
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/25a2fac4

Branch: refs/heads/master
Commit: 25a2fac453f1a39db9d1f7f759a4fdca80269eca
Parents: 76a4a2c
Author: Mark Payne <markap14@hotmail.com>
Authored: Wed Aug 10 13:57:45 2016 -0400
Committer: Bryan Bende <bbende@apache.org>
Committed: Thu Aug 11 10:44:28 2016 -0400

----------------------------------------------------------------------
 .../apache/nifi/fingerprint/FingerprintFactory.java    | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/25a2fac4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/fingerprint/FingerprintFactory.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/fingerprint/FingerprintFactory.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/fingerprint/FingerprintFactory.java
index 20bdb60..88fbcdd 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/fingerprint/FingerprintFactory.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/fingerprint/FingerprintFactory.java
@@ -610,7 +610,7 @@ public final class FingerprintFactory {
         // If we have a Processor to use, first determine if the value given is the default
value for the specified property.
         // If so, we do not add the property to the fingerprint.
         // We do this because if a Processor is updated to add a new property, whenever we
connect to the cluster, we have issues because
-        // the NCM's flow comes from disk, where the flow.xml doesn't have the new property
but our FlowController does have the new property.
+        // the Cluster Coordinator's flow comes from disk, where the flow.xml doesn't have
the new property but our FlowController does have the new property.
         // This causes the fingerprints not to match. As a result, we just ignore default
values, and this resolves the issue.
         if (processor != null) {
             final String propName = DomUtils.getChildElementsByTagName(propElem, "name").get(0).getTextContent();
@@ -627,11 +627,16 @@ public final class FingerprintFactory {
             }
         }
 
-        // name
+        // check if there is a value
+        String propValue = getFirstValue(DomUtils.getChildNodesByTagName(propElem, "value"),
null);
+        if (propValue == null) {
+            return builder;
+        }
+
+        // append name
         appendFirstValue(builder, DomUtils.getChildNodesByTagName(propElem, "name"));
 
-        // value
-        String propValue = getFirstValue(DomUtils.getChildNodesByTagName(propElem, "value"));
+        // append value
         if (isEncrypted(propValue)) {
             propValue = decrypt(propValue);
         }


Mime
View raw message