Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-7016

Optimize locking codepath in LocalDirAllocator.getLocalPathToRead() and reduce creating many Path objects



    • Type: Improvement
    • Status: Patch Available
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.20.2
    • Fix Version/s: None
    • Component/s: fs
    • Labels:


      LocalDirAllocator.getLocalPathToRead() is called from TaskTracker to retrieve temporary map output location. This method is synchronized and amount of time spent on this method directly affects the performance of TaskTracker's ability to serve faster. This JIRA is created to reduce the additional fat in getLocalPathToRead() and reduce creating the number of Path obejcts which are expensive.

      1. getLocalPathToRead() internally calls RawLocalFileSystem.exists() in order to check the existence of a local file. RawLocalFileSystem.exists() internally creates a FileStatus object which needs to be populated with lastModified, length, directory details etc. This might not be necessary for just checking file existence.

      2. Creating a Path object out of a string requires fair amount of processing. It might be worth to store "localDirsPath" in LocalDirAllocator instead of storing "localDirs". This would avoid the number of times Path() object is created in LocalDirAllocator.

      Any other codepath using LocalDirAllocator would also benefit from the above 2 optimizations.

      The attached patch addresses the above 2 issues.


        1. HADOOP-7016-v3.Yahoo.patch
          7 kB
          Rajesh Balamohan
        2. HADOOP-7016-v2.Yahoo.patch
          9 kB
          Rajesh Balamohan
        3. HADOOP-7016-Yahoo.patch
          7 kB
          Rajesh Balamohan

          Issue Links



              • Assignee:
                rajesh.balamohan Rajesh Balamohan
                rajesh.balamohan Rajesh Balamohan
              • Votes:
                0 Vote for this issue
                7 Start watching this issue


                • Created: