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

Avoid initializing unnecessary objects in method getBlockRecoveryCommand

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • namenode
    • None

    Description

      In method getBlockRecoveryCommand, we have below codes:

             else {
              rBlock = new RecoveringBlock(primaryBlock, recoveryInfos,
                  uc.getBlockRecoveryId());
              if (b.isStriped()) {
                rBlock = new RecoveringStripedBlock(rBlock,
                    uc.getBlockIndicesForSpecifiedStorages(storageIdx),
                    ((BlockInfoStriped) b).getErasureCodingPolicy());
              } 

      It seems that we initialize RecoveringBlock object every time even though b.isStriped returns true.

      This is unnecessary.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: