/** * Common method used for cleaning out parquet files under a partition path during rollback of a * set of commits */ protected Map<FileStatus, Boolean> deleteCleanedFiles(String partitionPath, List<String> commits) throws IOException { Map<FileStatus, Boolean> results = Maps.newHashMap(); // PathFilter to get all parquet files and log files that need to be deleted PathFilter filter = (path) -> { if (path.toString().contains(".parquet")) { String fileCommitTime = FSUtils.getCommitTime(path.getName()); return commits.contains(fileCommitTime); } return false; }; deleteCleanedFiles(results, partitionPath, filter); return results; }
/** * Common method used for cleaning out parquet files under a partition path during rollback of a * set of commits */ protected Map<FileStatus, Boolean> deleteCleanedFiles(String partitionPath, List<String> commits) throws IOException { Map<FileStatus, Boolean> results = Maps.newHashMap(); // PathFilter to get all parquet files and log files that need to be deleted PathFilter filter = (path) -> { if (path.toString().contains(".parquet")) { String fileCommitTime = FSUtils.getCommitTime(path.getName()); return commits.contains(fileCommitTime); } return false; }; deleteCleanedFiles(results, partitionPath, filter); return results; }
.map((Function<String, HoodieRollbackStat>) partitionPath -> { Map<FileStatus, Boolean> results = deleteCleanedFiles(partitionPath, commits); return HoodieRollbackStat.newBuilder().withPartitionPath(partitionPath) .withDeletedFileResults(results).build();
.map((Function<String, HoodieRollbackStat>) partitionPath -> { Map<FileStatus, Boolean> results = deleteCleanedFiles(partitionPath, commits); return HoodieRollbackStat.newBuilder().withPartitionPath(partitionPath) .withDeletedFileResults(results).build();
try { Map<FileStatus, Boolean> results = super .deleteCleanedFiles(partitionPath, Collections.singletonList(commit)); hoodieRollbackStats = HoodieRollbackStat.newBuilder() .withPartitionPath(partitionPath).withDeletedFileResults(results).build(); super.deleteCleanedFiles(filesToDeletedStatus, partitionPath, filter); final Set<String> deletedFiles = filesToDeletedStatus.entrySet().stream() .map(entry -> {
try { Map<FileStatus, Boolean> results = super .deleteCleanedFiles(partitionPath, Arrays.asList(commit)); hoodieRollbackStats = HoodieRollbackStat.newBuilder() .withPartitionPath(partitionPath).withDeletedFileResults(results).build(); super.deleteCleanedFiles(filesToDeletedStatus, partitionPath, filter); final Set<String> deletedFiles = filesToDeletedStatus.entrySet().stream() .map(entry -> {