NIFI-632 moving thread start to init method
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/db1302ec Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/db1302ec Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/db1302ec Branch: refs/heads/NIFI-632 Commit: db1302ecbe6ccdb688d129a57ef734d64d6a2ed2 Parents: e797368 Author: danbress <dbr...@onyxconsults.com> Authored: Mon Jun 8 22:06:23 2015 -0400 Committer: danbress <dbr...@onyxconsults.com> Committed: Mon Jun 8 22:06:23 2015 -0400 ---------------------------------------------------------------------- .../controller/repository/FileSystemRepository.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/db1302ec/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java index e212bdb..3a03fad 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java @@ -193,11 +193,6 @@ public class FileSystemRepository implements ContentRepository { LOG.info("Initializing FileSystemRepository with 'Always Sync' set to {}", alwaysSync); initializeRepository(); - executor.scheduleWithFixedDelay(new BinDestructableClaims(), 1, 1, TimeUnit.SECONDS); - for (int i = 0; i < fileRespositoryPaths.size(); i++) { - executor.scheduleWithFixedDelay(new ArchiveOrDestroyDestructableClaims(), 1, 1, TimeUnit.SECONDS); - } - final long cleanupMillis; if (archiveCleanupFrequency == null) { cleanupMillis = 1000L; @@ -221,6 +216,15 @@ public class FileSystemRepository implements ContentRepository { @Override public void initialize(final ContentClaimManager claimManager) { this.contentClaimManager = claimManager; + + final NiFiProperties properties = NiFiProperties.getInstance(); + + final Map<String, Path> fileRespositoryPaths = properties.getContentRepositoryPaths(); + + executor.scheduleWithFixedDelay(new BinDestructableClaims(), 1, 1, TimeUnit.SECONDS); + for (int i = 0; i < fileRespositoryPaths.size(); i++) { + executor.scheduleWithFixedDelay(new ArchiveOrDestroyDestructableClaims(), 1, 1, TimeUnit.SECONDS); + } } @Override