public FlowFileRepositorySchema(Map map) { partitions = getOptionalKeyAsType(map, PARTITIONS_KEY, Number.class, FLOWFILE_REPO_KEY, DEFAULT_PARTITIONS); checkpointInterval = getOptionalKeyAsType(map, CHECKPOINT_INTERVAL_KEY, String.class, FLOWFILE_REPO_KEY, DEFAULT_CHECKPOINT_INTERVAL); alwaysSync = getOptionalKeyAsType(map, ALWAYS_SYNC_KEY, Boolean.class, FLOWFILE_REPO_KEY, DEFAULT_ALWAYS_SYNC); swapProperties = getMapAsType(map, SWAP_PROPS_KEY, SwapSchema.class, FLOWFILE_REPO_KEY, false); addIssuesIfNotNull(swapProperties); }
@Override public Map<String, Object> toMap() { Map<String, Object> result = mapSupplier.get(); result.put(PARTITIONS_KEY, partitions); result.put(CHECKPOINT_INTERVAL_KEY, checkpointInterval); result.put(ALWAYS_SYNC_KEY, alwaysSync); putIfNotNull(result, SWAP_PROPS_KEY, swapProperties); return result; }
CorePropertiesSchema coreProperties = configSchema.getCoreProperties(); FlowFileRepositorySchema flowfileRepoSchema = configSchema.getFlowfileRepositoryProperties(); SwapSchema swapProperties = flowfileRepoSchema.getSwapProperties(); ContentRepositorySchema contentRepoProperties = configSchema.getContentRepositoryProperties(); ComponentStatusRepositorySchema componentStatusRepoProperties = configSchema.getComponentStatusRepositoryProperties(); System.lineSeparator() + "# FlowFile Repository"); orderedProperties.setProperty("nifi.flowfile.repository.directory", "./flowfile_repository"); orderedProperties.setProperty("nifi.flowfile.repository.partitions", String.valueOf(flowfileRepoSchema.getPartitions())); orderedProperties.setProperty("nifi.flowfile.repository.checkpoint.interval", flowfileRepoSchema.getCheckpointInterval()); orderedProperties.setProperty("nifi.flowfile.repository.always.sync", Boolean.toString(flowfileRepoSchema.getAlwaysSync()));