NIFI-2333: Consider reporting tasks and controller services when determining whether or not flow is empty

This closes #693

Signed-off-by: jpercivall <joepercivall@yahoo.com>
This commit is contained in:
Mark Payne 2016-07-20 15:25:32 -04:00 committed by jpercivall
parent 10b91ffe6c
commit 370d88eeeb

View File

@ -162,7 +162,7 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
try { try {
if (initialized) { if (initialized) {
existingFlow = toBytes(controller); existingFlow = toBytes(controller);
existingFlowEmpty = controller.getGroup(controller.getRootGroupId()).isEmpty(); existingFlowEmpty = controller.getGroup(controller.getRootGroupId()).isEmpty() && controller.getAllReportingTasks().isEmpty() && controller.getAllControllerServices().isEmpty();
} else { } else {
existingFlow = readFlowFromDisk(); existingFlow = readFlowFromDisk();
if (existingFlow == null || existingFlow.length == 0) { if (existingFlow == null || existingFlow.length == 0) {