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

Prefer ArrayList over LinkedList in VolumeScanner

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.2.0
    • 3.3.0
    • datanode
    • None
    • Reviewed
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: