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

o.a.h.fs.FileSystem.Cache#remove should use a single hash map lookup

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.6.0
    • 2.8.0, 3.0.0-alpha1
    • fs
    • None
    • Reviewed

    Description

      The method looks up the same key in the same hash map potentially 3 times

      if (map.containsKey(key) && fs == map.get(key)) {
        map.remove(key)
      

      Instead it could do a single lookup

      FileSystem cachedFs = map.remove(key);
      

      and then test cachedFs == fs or something else.

      Attachments

        1. HADDOOP-11659-004.patch
          1 kB
          Brahma Reddy Battula
        2. HADOOP-11659.patch
          0.8 kB
          Brahma Reddy Battula
        3. HADOOP-11659-002.patch
          1.0 kB
          Brahma Reddy Battula
        4. HADOOP-11659-003.patch
          1.0 kB
          Brahma Reddy Battula

        Activity

          People

            brahmareddy Brahma Reddy Battula
            jira.shegalov Gera Shegalov
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: