If I configured several ${mapred.local.dir} directories to store immediate result of Map Task, these directories mounted different disks.
My questions are:
1. Whether LocalDirAllocator.java
is used to manage ${mapred.local.dir} directories?
2.The method getLocalPathForWrite()
of LocalDirAllocator.java
is used to select a ${mapred.local.dir} directory?
Yes, the tasktracker uses
LocalDirAllocator
to manage the local directories/ disks inorder to store intermmediate data.(The by which it allocate space is given in the explanation)There are 3 overloaded methods in
LocalDirAllocator
corresponding togetLocalPathForWrite()
.They round-robin over the set of disks (via the configured dirs) and return the first complete path which has enough space.Explantion From the java doc:
LocalDirAllocator.java
Note:
I don't think we can directly override its behaviour, unless we override behaviour of its dependents!