Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support getFileBlockLocation in LocalCacheFileSystem #17672

Merged
merged 3 commits into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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;
Expand Down Expand Up @@ -205,4 +206,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);
Copy link
Contributor

@jiacheliu3 jiacheliu3 Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// 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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbw9580 @maobaolong what do you think about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it

}

@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);
}
}