Source:
private void cleanBaseDirsAndReadOffsetFiles() { LOG.debug("Cleaning base directories for stores."); taskStores.keySet().forEach(storeName -> { File nonLoggedStorePartitionDir = StorageManagerUtil.getStorePartitionDir(nonLoggedStoreBaseDirectory, storeName, taskModel.getTaskName()); LOG.info("Got non logged storage partition directory as " + nonLoggedStorePartitionDir.toPath().toString()); if (nonLoggedStorePartitionDir.exists()) { LOG.info("Deleting non logged storage partition directory " + nonLoggedStorePartitionDir.toPath().toString()); FileUtil.rm(nonLoggedStorePartitionDir); } File loggedStorePartitionDir = StorageManagerUtil.getStorePartitionDir(loggedStoreBaseDirectory, storeName, taskModel.getTaskName()); LOG.info("Got logged storage partition directory as " + loggedStorePartitionDir.toPath().toString()); if (!isLoggedStoreValid(storeName, loggedStorePartitionDir)) { LOG.info("Deleting logged storage partition directory " + loggedStorePartitionDir.toPath().toString()); FileUtil.rm(loggedStorePartitionDir); } else { SystemStreamPartition changelogSSP = null; if (changelogSystemStreams.containsKey(storeName)) changelogSSP = new SystemStreamPartition(changelogSystemStreams.get(storeName), taskModel.getChangelogPartition()); Map<SystemStreamPartition, String> offset = StorageManagerUtil.readOffsetFile(loggedStorePartitionDir, Collections.singleton(changelogSSP)); LOG.info("Read offset " + offset + " for the store " + storeName + " from logged storage partition directory " + loggedStorePartitionDir); if (offset.get(changelogSSP) != null) { fileOffsets.put( new SystemStreamPartition(changelogSystemStreams.get(storeName), taskModel.getChangelogPartition()), offset.get(changelogSSP)); } } }); }

Target:
private void cleanBaseDirsAndReadOffsetFiles() { LOG.debug("Cleaning base directories for stores."); taskStores.keySet().forEach(storeName -> { File nonLoggedStorePartitionDir = StorageManagerUtil.getStorePartitionDir(nonLoggedStoreBaseDirectory, storeName, taskModel.getTaskName()); LOG.info("Got non logged storage partition directory as " + nonLoggedStorePartitionDir.toPath().toString()); if (nonLoggedStorePartitionDir.exists()) { LOG.info("Deleting non logged storage partition directory " + nonLoggedStorePartitionDir.toPath().toString()); FileUtil.rm(nonLoggedStorePartitionDir); } File loggedStorePartitionDir = StorageManagerUtil.getStorePartitionDir(loggedStoreBaseDirectory, storeName, taskModel.getTaskName()); LOG.info("Got logged storage partition directory as " + loggedStorePartitionDir.toPath().toString()); if (!isLoggedStoreValid(storeName, loggedStorePartitionDir)) { LOG.info("Deleting logged storage partition directory " + loggedStorePartitionDir.toPath().toString()); FileUtil.rm(loggedStorePartitionDir); } else { SystemStreamPartition changelogSSP = new SystemStreamPartition(changelogSystemStreams.get(storeName), taskModel.getChangelogPartition()); Map<SystemStreamPartition, String> offset = StorageManagerUtil.readOffsetFile(loggedStorePartitionDir, Collections.singleton(changelogSSP)); LOG.info("Read offset for the store from logged storage partition directory {}", offset, storeName, loggedStorePartitionDir); if (offset.containsKey(changelogSSP)) { fileOffsets.put(changelogSSP, offset.get(changelogSSP)); } } }); }