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

Improve ReplicaMap#mergeAll method.

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Currently, the code is as below:

      for (ReplicaInfo replicaInfo : replicaSet) {
        checkBlock(replicaInfo);
        if (curSet == null) {
          // Add an entry for block pool if it does not exist already
          curSet = new LightWeightResizableGSet<>();
          map.put(bp, curSet);
        }
        curSet.put(replicaInfo);
      } 

      the statment :

      if(curSet == null)

      should be moved to outside from the for loop.

      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: