mirror of https://github.com/apache/nifi.git
NIFI-3848:
- Allowing the revision check to be overridden when the state of a nodes connection to the cluster changes. This closes #1811
This commit is contained in:
parent
6b71b4cbb8
commit
c50d516076
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
}));
|
Loading…
Reference in New Issue