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

Reusing the volume storage ID obtained by replicaInfo

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.1.0
    • datanode
    • 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

        1. HDFS-13036.001.patch
          1 kB
          liaoyuxiangqin

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            liaoyuxiangqin liaoyuxiangqin
            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

                Slack

                  Issue deployment