You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by bb...@apache.org on 2016/11/29 14:54:47 UTC

nifi git commit: NIFI-2975: Only start expiring FlowFiles after FlowFile Repository has been restored

Repository: nifi
Updated Branches:
  refs/heads/master 92f17a995 -> 9d6ca6e1e


NIFI-2975: Only start expiring FlowFiles after FlowFile Repository has been restored

This closes #1274.

Signed-off-by: Bryan Bende <bb...@apache.org>


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

Branch: refs/heads/master
Commit: 9d6ca6e1e60e604852cb3ad46eba6d58189b0864
Parents: 92f17a9
Author: Mark Payne <ma...@hotmail.com>
Authored: Mon Nov 28 16:15:05 2016 -0500
Committer: Bryan Bende <bb...@apache.org>
Committed: Tue Nov 29 09:54:15 2016 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/nifi/controller/FlowController.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/9d6ca6e1/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
index adab649..f78363e 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
@@ -484,7 +484,6 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R
         // PRIMARY_NODE_ONLY is deprecated, but still exists to handle processors that are still defined with it (they haven't been re-configured with executeNode = PRIMARY).
         processScheduler.setSchedulingAgent(SchedulingStrategy.PRIMARY_NODE_ONLY, timerDrivenAgent);
         processScheduler.setSchedulingAgent(SchedulingStrategy.CRON_DRIVEN, quartzSchedulingAgent);
-        processScheduler.scheduleFrameworkTask(new ExpireFlowFiles(this, contextFactory), "Expire FlowFiles", 30L, 30L, TimeUnit.SECONDS);
 
         startConnectablesAfterInitialization = new ArrayList<>();
         startRemoteGroupPortsAfterInitialization = new ArrayList<>();
@@ -699,6 +698,11 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R
 
             flowFileRepository.loadFlowFiles(this, maxIdFromSwapFiles + 1);
 
+            // Begin expiring FlowFiles that are old
+            final ProcessContextFactory contextFactory = new ProcessContextFactory(contentRepository, flowFileRepository,
+                flowFileEventRepository, counterRepositoryRef.get(), provenanceRepository);
+            processScheduler.scheduleFrameworkTask(new ExpireFlowFiles(this, contextFactory), "Expire FlowFiles", 30L, 30L, TimeUnit.SECONDS);
+
             // now that we've loaded the FlowFiles, this has restored our ContentClaims' states, so we can tell the
             // ContentRepository to purge superfluous files
             contentRepository.cleanup();