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

Prefer ArrayList over LinkedList in VolumeScanner

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.3.0
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Flags:
      Patch

      Description

      The sizeisEmptygetsetiterator, and listIterator operations run in constant time. - ArrayList

      However, for a LinkedList, the entire list must be traversed to get to the desired index.

      Like Here

      Most of the time, the List is being iterated, which is quicker over a primitive array than walking a LinkedList.

      There is one place where an item is removed, potentially from the middle of the list here but the speed of removing from the middle of the list isn't bad; it's a system native array shift, and it only happens on the off chance that a block pool is removed from the DataNode.

        Attachments

        1. HDFS-14296.1.patch
          1 kB
          David Mollitor

          Activity

            People

            • Assignee:
              belugabehr David Mollitor
              Reporter:
              belugabehr David Mollitor
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: