From 7facf95cc5eda83d2c7f29d63691b4480304392d Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Wed, 15 Jun 2016 12:04:25 -0400 Subject: [PATCH] NIFI-1997: Use the 'autoResumeState' property defined in nifi.properties on each node instead of inheriting the property from the Cluster Coordinator This closes #520 --- .../cluster/protocol/StandardDataFlow.java | 19 ------------------- .../jaxb/message/AdaptedDataFlow.java | 14 -------------- .../jaxb/message/DataFlowAdapter.java | 2 -- .../nifi/cluster/protocol/DataFlow.java | 5 ----- .../nifi/controller/StandardFlowService.java | 2 +- 5 files changed, 1 insertion(+), 41 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/StandardDataFlow.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/StandardDataFlow.java index fc3558a5d7..4f4b88d5e1 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/StandardDataFlow.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/StandardDataFlow.java @@ -34,8 +34,6 @@ public class StandardDataFlow implements Serializable, DataFlow { private final byte[] flow; private final byte[] snippetBytes; - private boolean autoStartProcessors; - /** * Constructs an instance. * @@ -55,7 +53,6 @@ public class StandardDataFlow implements Serializable, DataFlow { public StandardDataFlow(final DataFlow toCopy) { this.flow = copy(toCopy.getFlow()); this.snippetBytes = copy(toCopy.getSnippets()); - this.autoStartProcessors = toCopy.isAutoStartProcessors(); } private static byte[] copy(final byte[] bytes) { @@ -72,20 +69,4 @@ public class StandardDataFlow implements Serializable, DataFlow { public byte[] getSnippets() { return snippetBytes; } - - @Override - public boolean isAutoStartProcessors() { - return autoStartProcessors; - } - - /** - * - * Sets the flag to automatically start processors at application startup. - * - * @param autoStartProcessors true if processors should be automatically - * started at application startup; false otherwise - */ - public void setAutoStartProcessors(final boolean autoStartProcessors) { - this.autoStartProcessors = autoStartProcessors; - } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/jaxb/message/AdaptedDataFlow.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/jaxb/message/AdaptedDataFlow.java index 62796d7190..8ce905ba94 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/jaxb/message/AdaptedDataFlow.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/jaxb/message/AdaptedDataFlow.java @@ -23,11 +23,6 @@ public class AdaptedDataFlow { private byte[] flow; private byte[] snippets; - private boolean autoStartProcessors; - - public AdaptedDataFlow() { - } - public byte[] getFlow() { return flow; } @@ -43,13 +38,4 @@ public class AdaptedDataFlow { public void setSnippets(byte[] snippets) { this.snippets = snippets; } - - public boolean isAutoStartProcessors() { - return autoStartProcessors; - } - - public void setAutoStartProcessors(boolean runningAllProcessors) { - this.autoStartProcessors = runningAllProcessors; - } - } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/jaxb/message/DataFlowAdapter.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/jaxb/message/DataFlowAdapter.java index fc7f54f420..bd45a993d4 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/jaxb/message/DataFlowAdapter.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/jaxb/message/DataFlowAdapter.java @@ -32,7 +32,6 @@ public class DataFlowAdapter extends XmlAdapter { if (df != null) { aDf.setFlow(df.getFlow()); aDf.setSnippets(df.getSnippets()); - aDf.setAutoStartProcessors(df.isAutoStartProcessors()); } return aDf; @@ -41,7 +40,6 @@ public class DataFlowAdapter extends XmlAdapter { @Override public DataFlow unmarshal(final AdaptedDataFlow aDf) { final StandardDataFlow dataFlow = new StandardDataFlow(aDf.getFlow(), aDf.getSnippets()); - dataFlow.setAutoStartProcessors(aDf.isAutoStartProcessors()); return dataFlow; } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/cluster/protocol/DataFlow.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/cluster/protocol/DataFlow.java index 312e3b021a..a4daa40650 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/cluster/protocol/DataFlow.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/cluster/protocol/DataFlow.java @@ -28,9 +28,4 @@ public interface DataFlow { */ public byte[] getSnippets(); - /** - * @return true if processors should be automatically started at application - * startup; false otherwise - */ - public boolean isAutoStartProcessors(); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowService.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowService.java index 922bff06a5..3dc2588ffa 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowService.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowService.java @@ -855,7 +855,7 @@ public class StandardFlowService implements FlowService, ProtocolHandler { controller.setConnectionStatus(new NodeConnectionStatus(nodeId, NodeConnectionState.CONNECTED)); // start the processors as indicated by the dataflow - controller.onFlowInitialized(dataFlow.isAutoStartProcessors()); + controller.onFlowInitialized(autoResumeState); loadSnippets(dataFlow.getSnippets());