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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.15.1
    • 0.17.0
    • None
    • None
    • 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_20080130.patch
          14 kB
          Tsz-wo Sze
        2. 2423_20080303.patch
          13 kB
          Tsz-wo Sze
        3. 2423_20080304.patch
          5 kB
          Tsz-wo Sze
        4. 2423_20080304b.patch
          8 kB
          Tsz-wo Sze
        5. 2423_20080304c.patch
          8 kB
          Tsz-wo Sze
        6. 2423_20080304d.patch
          8 kB
          Tsz-wo Sze
        7. 2423_20080310.patch
          7 kB
          Tsz-wo Sze
        8. 2423_20080311.patch
          7 kB
          Tsz-wo Sze

        Issue Links

          Activity

            People

              szetszwo Tsz-wo Sze
              szetszwo Tsz-wo Sze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: