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

cleanup unnecssary code logic in LocatedBlock

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.7.0
    • 2.7.0
    • None
    • None
    • 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.002.patch
          5 kB
          Yi Liu
        2. HDFS-7761.001.patch
          3 kB
          Yi Liu

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: