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

[TEZ-4019] Modify Tez shuffle handler to use AuxiliaryLocalPathHandler instead of LocalDirAllocator #355

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
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 @@ -62,7 +62,6 @@
import org.apache.hadoop.fs.FileContext;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.LocalDirAllocator;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.DataInputByteBuffer;
import org.apache.hadoop.io.DataOutputBuffer;
Expand Down Expand Up @@ -903,8 +902,6 @@ class Shuffle extends ChannelInboundHandlerAdapter {
private static final int ALLOWED_CONCURRENCY = 16;
private final Configuration conf;
private final IndexCache indexCache;
private final LocalDirAllocator lDirAlloc =
new LocalDirAllocator(YarnConfiguration.NM_LOCAL_DIRS);
private int port;
private final LoadingCache<AttemptPathIdentifier, AttemptPathInfo> pathCache =
CacheBuilder.newBuilder().expireAfterAccess(EXPIRE_AFTER_ACCESS_MINUTES,
Expand Down Expand Up @@ -937,10 +934,10 @@ public AttemptPathInfo load(AttemptPathIdentifier key) throws
Exception {
String base = getBaseLocation(key.jobId, key.dagId, key.user);
String attemptBase = base + key.attemptId;
Path indexFileName = lDirAlloc.getLocalPathToRead(
attemptBase + Path.SEPARATOR + INDEX_FILE_NAME, conf);
Path mapOutputFileName = lDirAlloc.getLocalPathToRead(
attemptBase + Path.SEPARATOR + DATA_FILE_NAME, conf);
Path indexFileName = getAuxiliaryLocalPathHandler()
.getLocalPathForRead(attemptBase + "/" + INDEX_FILE_NAME);
Path mapOutputFileName = getAuxiliaryLocalPathHandler()
.getLocalPathForRead(attemptBase + "/" + DATA_FILE_NAME);

LOG.debug("Loaded : {} via loader", key);
return new AttemptPathInfo(indexFileName, mapOutputFileName);
Expand Down Expand Up @@ -1154,7 +1151,7 @@ private boolean deleteDagDirectories(Channel channel,
String base = getDagLocation(jobQ.get(0), dagIdQ.get(0), userRsrc.get(jobQ.get(0)));
try {
FileContext lfc = FileContext.getLocalFSFileContext();
for(Path dagPath : lDirAlloc.getAllLocalPathsToRead(base, conf)) {
for(Path dagPath : getAuxiliaryLocalPathHandler().getAllLocalPathsForRead(base)) {
lfc.delete(dagPath, true);
}
} catch (IOException e) {
Expand Down Expand Up @@ -1196,7 +1193,7 @@ private boolean deleteTaskAttemptDirectories(Channel channel, List<String> taskA
String baseStr = getBaseLocation(jobQ.get(0), dagIdQ.get(0), userRsrc.get(jobQ.get(0)));
try {
FileSystem fs = FileSystem.getLocal(conf).getRaw();
for (Path basePath : lDirAlloc.getAllLocalPathsToRead(baseStr, conf)) {
for (Path basePath : getAuxiliaryLocalPathHandler().getAllLocalPathsForRead(baseStr)) {
for (FileStatus fileStatus : fs.listStatus(basePath)) {
Path taskAttemptPath = fileStatus.getPath();
if (taskAttemptPath.getName().startsWith(taskAttemptId)) {
Expand Down Expand Up @@ -1293,7 +1290,7 @@ private String getBaseLocation(String jobId, String dagId, String user) {
private void deleteTaskDirsOfVertex(String jobId, String dagId, String vertexId, String user) throws IOException {
String baseStr = getBaseLocation(jobId, dagId, user);
FileContext lfc = FileContext.getLocalFSFileContext();
for(Path dagPath : lDirAlloc.getAllLocalPathsToRead(baseStr, conf)) {
for(Path dagPath : getAuxiliaryLocalPathHandler().getAllLocalPathsForRead(baseStr)) {
RemoteIterator<FileStatus> status = lfc.listStatus(dagPath);
final JobID jobID = JobID.forName(jobId);
String taskDirPrefix = String.format("attempt%s_%s_%s_",
Expand Down
Loading
Loading