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

Reusing the volume storage ID obtained by replicaInfo

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.1.0
    • Component/s: datanode
    • Labels:
      None

      Description

      When i read the getBlockReports() of FsDatasetImpl class in datanode, i found the following case code could be more simplify and need't to obtained volume storage ID by replicaInfo again and again, because the vol id have get by above code.Thanks.

      FsDatasetImpl.java
      switch(b.getState()) {
      case FINALIZED:
      case RBW:
      case RWR:
       builders.get(b.getVolume().getStorageID()).add(b);
       break;
      case RUR:
       ReplicaInfo orig = b.getOriginalReplica();
       builders.get(b.getVolume().getStorageID()).add(orig);
       break;
      case TEMPORARY:
       break;
      default:
       assert false : "Illegal ReplicaInfo state.";
      }
      
      

        Attachments

          Activity

            People

            • Assignee:
              liaoyuxiangqin liaoyuxiangqin
              Reporter:
              liaoyuxiangqin liaoyuxiangqin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified