public WriteAheadFlowFileRepository(final NiFiProperties nifiProperties) { alwaysSync = Boolean.parseBoolean(nifiProperties.getProperty(NiFiProperties.FLOWFILE_REPOSITORY_ALWAYS_SYNC, "false")); this.nifiProperties = nifiProperties; // determine the database file path and ensure it exists String writeAheadLogImpl = nifiProperties.getProperty(WRITE_AHEAD_LOG_IMPL); if (writeAheadLogImpl == null) { writeAheadLogImpl = DEFAULT_WAL_IMPLEMENTATION; } this.walImplementation = writeAheadLogImpl; // We used to use one implementation of the write-ahead log, but we now want to use the other, we must address this. Since the // MinimalLockingWriteAheadLog supports multiple partitions, we need to ensure that we recover records from all // partitions, so we build up a List of Files for the recovery files. for (final String propertyName : nifiProperties.getPropertyKeys()) { if (propertyName.startsWith(FLOWFILE_REPOSITORY_DIRECTORY_PREFIX)) { final String dirName = nifiProperties.getProperty(propertyName); recoveryFiles.add(new File(dirName)); } } if (walImplementation.equals(SEQUENTIAL_ACCESS_WAL)) { final String directoryName = nifiProperties.getProperty(FLOWFILE_REPOSITORY_DIRECTORY_PREFIX); flowFileRepositoryPaths.add(new File(directoryName)); } else { flowFileRepositoryPaths.addAll(recoveryFiles); } numPartitions = nifiProperties.getFlowFileRepositoryPartitions(); checkpointDelayMillis = FormatUtils.getTimeDuration(nifiProperties.getFlowFileRepositoryCheckpointInterval(), TimeUnit.MILLISECONDS); checkpointExecutor = Executors.newSingleThreadScheduledExecutor(); }