diff --git a/dora/core/client/hdfs/src/main/java/alluxio/hadoop/LocalCacheFileSystem.java b/dora/core/client/hdfs/src/main/java/alluxio/hadoop/LocalCacheFileSystem.java index b447db74eaa2..11fd81455d86 100644 --- a/dora/core/client/hdfs/src/main/java/alluxio/hadoop/LocalCacheFileSystem.java +++ b/dora/core/client/hdfs/src/main/java/alluxio/hadoop/LocalCacheFileSystem.java @@ -29,6 +29,7 @@ import alluxio.wire.FileInfo; import com.google.common.base.Preconditions; +import org.apache.hadoop.fs.BlockLocation; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileStatus; @@ -242,4 +243,22 @@ public boolean mkdirs(Path f, FsPermission permission) throws IOException { public FileStatus getFileStatus(Path f) throws IOException { return mExternalFileSystem.getFileStatus(f); } + + @Override + public BlockLocation[] getFileBlockLocations(FileStatus file, long start, + long len) throws IOException { + // Applications use the block information here to schedule/distribute the tasks. + // Return the UFS locations directly instead of the local cache location, + // so the application can schedule the tasks accordingly + return mExternalFileSystem.getFileBlockLocations(file, start, len); + } + + @Override + public BlockLocation[] getFileBlockLocations(Path p, long start, long len) + throws IOException { + // Applications use the block information here to schedule/distribute the tasks. + // Return the UFS locations directly instead of the local cache location, + // so the application can schedule the tasks accordingly + return mExternalFileSystem.getFileBlockLocations(p, start, len); + } }