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

Optimize method BlockInfoStriped#findSlot to reduce time complexity.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • hdfs
    • Reviewed

    Description

      Currently, in method findSlot. there exists codes snippet below:

      for (; i < getCapacity(); i++) {
        if (getStorageInfo(i) == null) {
          return i;
        }
      } 

      it will compute ´╝łtriplets.length / 3 every iteration, I think this can be optimized.

      Attachments

        Issue Links

          Activity

            People

              zhanghaobo farmmamba
              zhanghaobo farmmamba
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: