Skip to content

Commit

Permalink
Core: Generalize Util.blockLocations (#11053)
Browse files Browse the repository at this point in the history
  • Loading branch information
okumin authored Dec 4, 2024
1 parent 3278b69 commit 8c04bcb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/src/main/java/org/apache/iceberg/hadoop/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,18 @@ public static FileSystem getFs(Path path, Configuration conf) {
}
}

/**
* @deprecated since 1.8.0, will be removed in 1.9.0; use {@link
* Util#blockLocations(ScanTaskGroup, Configuration)} instead.
*/
@Deprecated
public static String[] blockLocations(CombinedScanTask task, Configuration conf) {
return blockLocations((ScanTaskGroup<FileScanTask>) task, conf);
}

public static String[] blockLocations(ScanTaskGroup<FileScanTask> taskGroup, Configuration conf) {
Set<String> locationSets = Sets.newHashSet();
for (FileScanTask f : task.files()) {
for (FileScanTask f : taskGroup.tasks()) {
Path path = new Path(f.file().location());
try {
FileSystem fs = path.getFileSystem(conf);
Expand Down

0 comments on commit 8c04bcb

Please sign in to comment.