Repository: nifi
Updated Branches:
  refs/heads/master 6b71b4cbb -> c50d51607


NIFI-3848:
- Allowing the revision check to be overridden when the state of a nodes 
connection to the cluster changes.

This closes #1811


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

Branch: refs/heads/master
Commit: c50d5160767e01373ca5785f7cb8856bff311dd5
Parents: 6b71b4c
Author: Matt Gilman <[email protected]>
Authored: Tue May 16 14:37:38 2017 -0400
Committer: Jeff Storck <[email protected]>
Committed: Tue May 16 17:09:48 2017 -0400

----------------------------------------------------------------------
 .../src/main/webapp/js/nf/canvas/nf-canvas.js       |  3 ++-
 .../src/main/webapp/js/nf/canvas/nf-connection.js   |  4 +++-
 .../src/main/webapp/js/nf/canvas/nf-funnel.js       |  4 +++-
 .../src/main/webapp/js/nf/canvas/nf-label.js        |  4 +++-
 .../src/main/webapp/js/nf/canvas/nf-port.js         |  4 +++-
 .../main/webapp/js/nf/canvas/nf-process-group.js    |  4 +++-
 .../src/main/webapp/js/nf/canvas/nf-processor.js    |  4 +++-
 .../webapp/js/nf/canvas/nf-remote-process-group.js  |  4 +++-
 .../src/main/webapp/js/nf/nf-cluster-summary.js     | 16 ++++++++++++++++
 9 files changed, 39 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/c50d5160/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
index 051f397..ecb1269 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
@@ -174,7 +174,8 @@
             // refresh the graph
             nfGraph.expireCaches(now);
             nfGraph.set(processGroupFlow.flow, $.extend({
-                'selectAll': false
+                'selectAll': false,
+                'overrideRevisionCheck': 
nfClusterSummary.didConnectedStateChange()
             }, options));
 
             // update component visibility

http://git-wip-us.apache.org/repos/asf/nifi/blob/c50d5160/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
index 6b0e5a9..caf6ff9 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
@@ -2000,16 +2000,18 @@
         set: function (connectionEntities, options) {
             var selectAll = false;
             var transition = false;
+            var overrideRevisionCheck = false;
             if (nfCommon.isDefinedAndNotNull(options)) {
                 selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? 
options.selectAll : selectAll;
                 transition = nfCommon.isDefinedAndNotNull(options.transition) 
? options.transition : transition;
+                overrideRevisionCheck = 
nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? 
options.overrideRevisionCheck : overrideRevisionCheck;
             }
 
             var set = function (proposedConnectionEntity) {
                 var currentConnectionEntity = 
connectionMap.get(proposedConnectionEntity.id);
 
                 // set the connection if appropriate due to revision and 
wasn't previously removed
-                if (nfClient.isNewerRevision(currentConnectionEntity, 
proposedConnectionEntity) && !removedCache.has(proposedConnectionEntity.id)) {
+                if ((nfClient.isNewerRevision(currentConnectionEntity, 
proposedConnectionEntity) && !removedCache.has(proposedConnectionEntity.id)) || 
overrideRevisionCheck === true) {
                     connectionMap.set(proposedConnectionEntity.id, $.extend({
                         type: 'Connection'
                     }, proposedConnectionEntity));

http://git-wip-us.apache.org/repos/asf/nifi/blob/c50d5160/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
index 44ff136..ed5051f 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
@@ -267,16 +267,18 @@
         set: function (funnelEntities, options) {
             var selectAll = false;
             var transition = false;
+            var overrideRevisionCheck = false;
             if (nfCommon.isDefinedAndNotNull(options)) {
                 selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? 
options.selectAll : selectAll;
                 transition = nfCommon.isDefinedAndNotNull(options.transition) 
? options.transition : transition;
+                overrideRevisionCheck = 
nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? 
options.overrideRevisionCheck : overrideRevisionCheck;
             }
 
             var set = function (proposedFunnelEntity) {
                 var currentFunnelEntity = 
funnelMap.get(proposedFunnelEntity.id);
 
                 // set the funnel if appropriate due to revision and wasn't 
previously removed
-                if (nfClient.isNewerRevision(currentFunnelEntity, 
proposedFunnelEntity) && !removedCache.has(proposedFunnelEntity.id)) {
+                if ((nfClient.isNewerRevision(currentFunnelEntity, 
proposedFunnelEntity) && !removedCache.has(proposedFunnelEntity.id)) || 
overrideRevisionCheck === true) {
                     funnelMap.set(proposedFunnelEntity.id, $.extend({
                         type: 'Funnel',
                         dimensions: dimensions

http://git-wip-us.apache.org/repos/asf/nifi/blob/c50d5160/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js
index 382b7e0..cce575c 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js
@@ -460,16 +460,18 @@
         set: function (labelEntities, options) {
             var selectAll = false;
             var transition = false;
+            var overrideRevisionCheck = false;
             if (nfCommon.isDefinedAndNotNull(options)) {
                 selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? 
options.selectAll : selectAll;
                 transition = nfCommon.isDefinedAndNotNull(options.transition) 
? options.transition : transition;
+                overrideRevisionCheck = 
nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? 
options.overrideRevisionCheck : overrideRevisionCheck;
             }
 
             var set = function (proposedLabelEntity) {
                 var currentLabelEntity = labelMap.get(proposedLabelEntity.id);
 
                 // set the processor if appropriate due to revision and wasn't 
previously removed
-                if (nfClient.isNewerRevision(currentLabelEntity, 
proposedLabelEntity) && !removedCache.has(proposedLabelEntity.id)) {
+                if ((nfClient.isNewerRevision(currentLabelEntity, 
proposedLabelEntity) && !removedCache.has(proposedLabelEntity.id)) || 
overrideRevisionCheck === true) {
                     labelMap.set(proposedLabelEntity.id, $.extend({
                         type: 'Label'
                     }, proposedLabelEntity));

http://git-wip-us.apache.org/repos/asf/nifi/blob/c50d5160/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js
index 06820bf..a574f0c 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js
@@ -606,9 +606,11 @@
         set: function (portEntities, options) {
             var selectAll = false;
             var transition = false;
+            var overrideRevisionCheck = false;
             if (nfCommon.isDefinedAndNotNull(options)) {
                 selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? 
options.selectAll : selectAll;
                 transition = nfCommon.isDefinedAndNotNull(options.transition) 
? options.transition : transition;
+                overrideRevisionCheck = 
nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? 
options.overrideRevisionCheck : overrideRevisionCheck;
             }
 
             // determine the appropriate dimensions for this port
@@ -621,7 +623,7 @@
                 var currentPortEntity = portMap.get(proposedPortEntity.id);
 
                 // set the port if appropriate due to revision and wasn't 
previously removed
-                if (nfClient.isNewerRevision(currentPortEntity, 
proposedPortEntity) && !removedCache.has(proposedPortEntity.id)) {
+                if ((nfClient.isNewerRevision(currentPortEntity, 
proposedPortEntity) && !removedCache.has(proposedPortEntity.id)) || 
overrideRevisionCheck === true) {
                     // add the port
                     portMap.set(proposedPortEntity.id, $.extend({
                         type: 'Port',

http://git-wip-us.apache.org/repos/asf/nifi/blob/c50d5160/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
index c142b75..13bbc70 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
@@ -1097,16 +1097,18 @@
         set: function (processGroupEntities, options) {
             var selectAll = false;
             var transition = false;
+            var overrideRevisionCheck = false;
             if (nfCommon.isDefinedAndNotNull(options)) {
                 selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? 
options.selectAll : selectAll;
                 transition = nfCommon.isDefinedAndNotNull(options.transition) 
? options.transition : transition;
+                overrideRevisionCheck = 
nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? 
options.overrideRevisionCheck : overrideRevisionCheck;
             }
 
             var set = function (proposedProcessGroupEntity) {
                 var currentProcessGroupEntity = 
processGroupMap.get(proposedProcessGroupEntity.id);
 
                 // set the process group if appropriate due to revision and 
wasn't previously removed
-                if (nfClient.isNewerRevision(currentProcessGroupEntity, 
proposedProcessGroupEntity) && 
!removedCache.has(proposedProcessGroupEntity.id)) {
+                if ((nfClient.isNewerRevision(currentProcessGroupEntity, 
proposedProcessGroupEntity) && 
!removedCache.has(proposedProcessGroupEntity.id)) || overrideRevisionCheck === 
true) {
                     processGroupMap.set(proposedProcessGroupEntity.id, 
$.extend({
                         type: 'ProcessGroup',
                         dimensions: dimensions

http://git-wip-us.apache.org/repos/asf/nifi/blob/c50d5160/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js
index bc09526..09b33db 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js
@@ -944,16 +944,18 @@
         set: function (processorEntities, options) {
             var selectAll = false;
             var transition = false;
+            var overrideRevisionCheck = false;
             if (nfCommon.isDefinedAndNotNull(options)) {
                 selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? 
options.selectAll : selectAll;
                 transition = nfCommon.isDefinedAndNotNull(options.transition) 
? options.transition : transition;
+                overrideRevisionCheck = 
nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? 
options.overrideRevisionCheck : overrideRevisionCheck;
             }
 
             var set = function (proposedProcessorEntity) {
                 var currentProcessorEntity = 
processorMap.get(proposedProcessorEntity.id);
 
                 // set the processor if appropriate due to revision and wasn't 
previously removed
-                if (nfClient.isNewerRevision(currentProcessorEntity, 
proposedProcessorEntity) && !removedCache.has(proposedProcessorEntity.id)) {
+                if ((nfClient.isNewerRevision(currentProcessorEntity, 
proposedProcessorEntity) && !removedCache.has(proposedProcessorEntity.id)) || 
overrideRevisionCheck === true) {
                     processorMap.set(proposedProcessorEntity.id, $.extend({
                         type: 'Processor',
                         dimensions: dimensions

http://git-wip-us.apache.org/repos/asf/nifi/blob/c50d5160/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js
index b91afd1..34005da 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js
@@ -931,16 +931,18 @@
         set: function (remoteProcessGroupEntities, options) {
             var selectAll = false;
             var transition = false;
+            var overrideRevisionCheck = false;
             if (nfCommon.isDefinedAndNotNull(options)) {
                 selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? 
options.selectAll : selectAll;
                 transition = nfCommon.isDefinedAndNotNull(options.transition) 
? options.transition : transition;
+                overrideRevisionCheck = 
nfCommon.isDefinedAndNotNull(options.overrideRevisionCheck) ? 
options.overrideRevisionCheck : overrideRevisionCheck;
             }
 
             var set = function (proposedRemoteProcessGroupEntity) {
                 var currentRemoteProcessGroupEntity = 
remoteProcessGroupMap.get(proposedRemoteProcessGroupEntity.id);
 
                 // set the remote process group if appropriate due to revision 
and wasn't previously removed
-                if (nfClient.isNewerRevision(currentRemoteProcessGroupEntity, 
proposedRemoteProcessGroupEntity) && 
!removedCache.has(proposedRemoteProcessGroupEntity.id)) {
+                if ((nfClient.isNewerRevision(currentRemoteProcessGroupEntity, 
proposedRemoteProcessGroupEntity) && 
!removedCache.has(proposedRemoteProcessGroupEntity.id)) || 
overrideRevisionCheck === true) {
                     
remoteProcessGroupMap.set(proposedRemoteProcessGroupEntity.id, $.extend({
                         type: 'RemoteProcessGroup',
                         dimensions: dimensions

http://git-wip-us.apache.org/repos/asf/nifi/blob/c50d5160/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js
index a06b771..9a0acad 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-cluster-summary.js
@@ -31,6 +31,7 @@
 }(this, function ($) {
     var clustered = false;
     var connectedToCluster = false;
+    var connectedStateChanged = false;
 
     var config = {
         urls: {
@@ -54,6 +55,11 @@
                 var clusterSummaryResponse = clusterSummaryResult;
                 var clusterSummary = clusterSummaryResponse.clusterSummary;
 
+                // see if the connected state changes
+                if (connectedToCluster !== clusterSummary.connectedToCluster) {
+                    connectedStateChanged = true;
+                }
+
                 // establish the initial cluster state
                 clustered = clusterSummary.clustered;
                 connectedToCluster = clusterSummary.connectedToCluster;
@@ -76,6 +82,16 @@
          */
         isConnectedToCluster: function () {
             return connectedToCluster === true;
+        },
+
+        /**
+         * Returns whether the connected state has changed since the last time
+         * didConnectedStateChange was invoked.
+         */
+        didConnectedStateChange: function () {
+            var stateChanged = connectedStateChanged;
+            connectedStateChanged = false;
+            return stateChanged;
         }
     };
 }));
\ No newline at end of file

Reply via email to