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

The codes in FSDirectory.mkdirs(...) is inefficient.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.15.1
    • Fix Version/s: 0.17.0
    • Component/s: None
    • Labels:
      None
    • Release Note:
      Improved FSDirectory.mkdirs(...) performance. In NNThroughputBenchmark-create, the ops per sec in was improved ~54%.

      Description

      FSDirectory.mkdirs(...) creates List<String> v to store all dirs. e.g.

      //Suppose 
      src = "/foo/bar/bas/"
      //Then,
      v = {"/", "/foo", "/foo/bar", "/foo/bar/bas"}
      

      For each directory string cur in v, no matter cur already exists or not, it will try to do a unprotectedMkdir(cur, ...). Then, cur is parsed to byte[][] in INodeDirectory.addNode (...).

      We don't need to do the parsing for each string in v. Instead, byte[][] should be stored. Also, the loop should not continue once it finds an existing subdirectory.

        Attachments

        1. 2423_20080311.patch
          7 kB
          Tsz Wo Nicholas Sze
        2. 2423_20080310.patch
          7 kB
          Tsz Wo Nicholas Sze
        3. 2423_20080304d.patch
          8 kB
          Tsz Wo Nicholas Sze
        4. 2423_20080304c.patch
          8 kB
          Tsz Wo Nicholas Sze
        5. 2423_20080304b.patch
          8 kB
          Tsz Wo Nicholas Sze
        6. 2423_20080304.patch
          5 kB
          Tsz Wo Nicholas Sze
        7. 2423_20080303.patch
          13 kB
          Tsz Wo Nicholas Sze
        8. 2423_20080130.patch
          14 kB
          Tsz Wo Nicholas Sze

          Issue Links

            Activity

              People

              • Assignee:
                szetszwo Tsz Wo Nicholas Sze
                Reporter:
                szetszwo Tsz Wo Nicholas Sze
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: