[ https://issues.apache.org/jira/browse/HDFS-15574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17197203#comment-17197203 ]
Stephen O'Donnell commented on HDFS-15574: ------------------------------------------ [~hemanthboyina] Looks like jenkins triggered on both branches and HDFS-15574.branch-3.3.002.patch is good for the 3.3 branch. HDFS-15574.branch-3.2.002.patch should be good for branch-3.1 and 3.2. Could you give them a quick check please and commit if you are happy, or if you give a +1 I can commit them. Thanks for your help on this. > Remove unnecessary sort of block list in DirectoryScanner > --------------------------------------------------------- > > Key: HDFS-15574 > URL: https://issues.apache.org/jira/browse/HDFS-15574 > Project: Hadoop HDFS > Issue Type: Improvement > Affects Versions: 3.4.0 > Reporter: Stephen O'Donnell > Assignee: Stephen O'Donnell > Priority: Major > Fix For: 3.4.0 > > Attachments: HDFS-15574.001.patch, HDFS-15574.002.patch, > HDFS-15574.003.patch, HDFS-15574.branch-3.2.001.patch, > HDFS-15574.branch-3.2.002.patch, HDFS-15574.branch-3.3.001.patch, > HDFS-15574.branch-3.3.002.patch > > > These lines of code in DirectoryScanner#scan(), obtain a snapshot of the > finalized blocks from memory, and then sort them, under the DN lock. However > the blocks are stored in a sorted structure (FoldedTreeSet) and hence the > sort should be unnecessary. > {code} > final List<ReplicaInfo> bl = dataset.getFinalizedBlocks(bpid); > Collections.sort(bl); // Sort based on blockId > {code} > This Jira removes the sort, and renames the getFinalizedBlocks to > getSortedFinalizedBlocks to make the intent of the method more clear. > Also added a test, just in case the underlying block structure is ever > changed to something unsorted. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org