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

cleanup unnecssary code logic in LocatedBlock

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.0
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      1. The usage of following two variables is unnecessary. We can remove them to make code a bit brief.

        private final boolean hasStorageIDs;
        private final boolean hasStorageTypes;

      2. In HDFS-7647, no need to modify LocatedBlock#getStorageTypes and LocatedBlock#getStorageIDs, we just need to update the cached storageIDs and storageTypes after sort.
      3. Another thing is we'd better setSoftwareVersion when constructing DatanodeInfoWithStorage from DatanodeInfo

        Attachments

        1. HDFS-7761.001.patch
          3 kB
          Yi Liu
        2. HDFS-7761.002.patch
          5 kB
          Yi Liu

          Issue Links

            Activity

              People

              • Assignee:
                hitliuyi Yi Liu
                Reporter:
                hitliuyi Yi Liu
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: