NIFI-632 moving thread start to init method

This commit is contained in:
danbress 2015-06-08 22:06:23 -04:00
parent 196da2b443
commit 089a27f227
1 changed files with 9 additions and 5 deletions

View File

@ -193,11 +193,6 @@ public class FileSystemRepository implements ContentRepository {
LOG.info("Initializing FileSystemRepository with 'Always Sync' set to {}", alwaysSync); LOG.info("Initializing FileSystemRepository with 'Always Sync' set to {}", alwaysSync);
initializeRepository(); 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; final long cleanupMillis;
if (archiveCleanupFrequency == null) { if (archiveCleanupFrequency == null) {
cleanupMillis = 1000L; cleanupMillis = 1000L;
@ -221,6 +216,15 @@ public class FileSystemRepository implements ContentRepository {
@Override @Override
public void initialize(final ContentClaimManager claimManager) { public void initialize(final ContentClaimManager claimManager) {
this.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 @Override