You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Xiaoqiao He (Jira)" <ji...@apache.org> on 2020/12/15 09:12:00 UTC

[jira] [Updated] (HDFS-15574) Remove unnecessary sort of block list in DirectoryScanner

     [ https://issues.apache.org/jira/browse/HDFS-15574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiaoqiao He updated HDFS-15574:
-------------------------------
    Fix Version/s: 3.2.2

Add fix version 3.2.2 + 3.2.3, Please update fix version tag in time when commit and backport, Thanks.

> 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.2.2, 3.3.1, 3.4.0, 3.1.5, 3.2.3
>
>         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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org