Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-13970

Use MultiMap for CacheManager Directives to simplify the code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.2.0
    • 3.3.0
    • caching, hdfs
    • None
    • Reviewed

    Description

      1. Use Guava Multimap to simplify code
        1. Currently, code uses a mix of LinkedList and ArrayList - just pick one
        2. Currently, directivesByPath structure is sorted but never used in a sorted way, it only performs remove and add operations, no iteration - use a Set instead of a List for values to support faster remove operation. Use a HashSet instead of a TreeSet for keys since it doesn't appear that order really matters.
      2. The CacheDirective class needs a better hashcode implementation since it will be used in a Set.  Do not instantiate a HashBuilder object every time hashcode is called. Ouch.

      Attachments

        1. HDFS-13970.2.patch
          5 kB
          David Mollitor
        2. HDFS-13970.1.patch
          5 kB
          David Mollitor

        Activity

          People

            belugabehr David Mollitor
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: