mirror of https://github.com/apache/nifi.git
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
This commit is contained in:
parent
992b5552bb
commit
7facf95cc5
|
@ -34,8 +34,6 @@ public class StandardDataFlow implements Serializable, DataFlow {
|
||||||
private final byte[] flow;
|
private final byte[] flow;
|
||||||
private final byte[] snippetBytes;
|
private final byte[] snippetBytes;
|
||||||
|
|
||||||
private boolean autoStartProcessors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an instance.
|
* Constructs an instance.
|
||||||
*
|
*
|
||||||
|
@ -55,7 +53,6 @@ public class StandardDataFlow implements Serializable, DataFlow {
|
||||||
public StandardDataFlow(final DataFlow toCopy) {
|
public StandardDataFlow(final DataFlow toCopy) {
|
||||||
this.flow = copy(toCopy.getFlow());
|
this.flow = copy(toCopy.getFlow());
|
||||||
this.snippetBytes = copy(toCopy.getSnippets());
|
this.snippetBytes = copy(toCopy.getSnippets());
|
||||||
this.autoStartProcessors = toCopy.isAutoStartProcessors();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] copy(final byte[] bytes) {
|
private static byte[] copy(final byte[] bytes) {
|
||||||
|
@ -72,20 +69,4 @@ public class StandardDataFlow implements Serializable, DataFlow {
|
||||||
public byte[] getSnippets() {
|
public byte[] getSnippets() {
|
||||||
return snippetBytes;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,11 +23,6 @@ public class AdaptedDataFlow {
|
||||||
private byte[] flow;
|
private byte[] flow;
|
||||||
private byte[] snippets;
|
private byte[] snippets;
|
||||||
|
|
||||||
private boolean autoStartProcessors;
|
|
||||||
|
|
||||||
public AdaptedDataFlow() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] getFlow() {
|
public byte[] getFlow() {
|
||||||
return flow;
|
return flow;
|
||||||
}
|
}
|
||||||
|
@ -43,13 +38,4 @@ public class AdaptedDataFlow {
|
||||||
public void setSnippets(byte[] snippets) {
|
public void setSnippets(byte[] snippets) {
|
||||||
this.snippets = snippets;
|
this.snippets = snippets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAutoStartProcessors() {
|
|
||||||
return autoStartProcessors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAutoStartProcessors(boolean runningAllProcessors) {
|
|
||||||
this.autoStartProcessors = runningAllProcessors;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,6 @@ public class DataFlowAdapter extends XmlAdapter<AdaptedDataFlow, DataFlow> {
|
||||||
if (df != null) {
|
if (df != null) {
|
||||||
aDf.setFlow(df.getFlow());
|
aDf.setFlow(df.getFlow());
|
||||||
aDf.setSnippets(df.getSnippets());
|
aDf.setSnippets(df.getSnippets());
|
||||||
aDf.setAutoStartProcessors(df.isAutoStartProcessors());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return aDf;
|
return aDf;
|
||||||
|
@ -41,7 +40,6 @@ public class DataFlowAdapter extends XmlAdapter<AdaptedDataFlow, DataFlow> {
|
||||||
@Override
|
@Override
|
||||||
public DataFlow unmarshal(final AdaptedDataFlow aDf) {
|
public DataFlow unmarshal(final AdaptedDataFlow aDf) {
|
||||||
final StandardDataFlow dataFlow = new StandardDataFlow(aDf.getFlow(), aDf.getSnippets());
|
final StandardDataFlow dataFlow = new StandardDataFlow(aDf.getFlow(), aDf.getSnippets());
|
||||||
dataFlow.setAutoStartProcessors(aDf.isAutoStartProcessors());
|
|
||||||
return dataFlow;
|
return dataFlow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,4 @@ public interface DataFlow {
|
||||||
*/
|
*/
|
||||||
public byte[] getSnippets();
|
public byte[] getSnippets();
|
||||||
|
|
||||||
/**
|
|
||||||
* @return true if processors should be automatically started at application
|
|
||||||
* startup; false otherwise
|
|
||||||
*/
|
|
||||||
public boolean isAutoStartProcessors();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -855,7 +855,7 @@ public class StandardFlowService implements FlowService, ProtocolHandler {
|
||||||
controller.setConnectionStatus(new NodeConnectionStatus(nodeId, NodeConnectionState.CONNECTED));
|
controller.setConnectionStatus(new NodeConnectionStatus(nodeId, NodeConnectionState.CONNECTED));
|
||||||
|
|
||||||
// start the processors as indicated by the dataflow
|
// start the processors as indicated by the dataflow
|
||||||
controller.onFlowInitialized(dataFlow.isAutoStartProcessors());
|
controller.onFlowInitialized(autoResumeState);
|
||||||
|
|
||||||
loadSnippets(dataFlow.getSnippets());
|
loadSnippets(dataFlow.getSnippets());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue