hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BELUGA BEHR (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-13978) Review of DiskBalancer
Date Mon, 15 Oct 2018 14:58:00 GMT

    [ https://issues.apache.org/jira/browse/HDFS-13978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16650328#comment-16650328
] 

BELUGA BEHR commented on HDFS-13978:
------------------------------------

All the failed unit tests are known flaky tests.  Please consider the patch for inclusion
into the project.

> Review of DiskBalancer
> ----------------------
>
>                 Key: HDFS-13978
>                 URL: https://issues.apache.org/jira/browse/HDFS-13978
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode, hdfs
>    Affects Versions: 3.2.0
>            Reporter: BELUGA BEHR
>            Assignee: BELUGA BEHR
>            Priority: Minor
>         Attachments: HDFS-13978.1.patch
>
>
> * Use ArrayList instead of LinkedList. Especially because this code here uses the {{List#get()}}
method, which is very slow for the LinkedList since it has to traverse every node to get to
the offset: O(N^2)
> {code}
>     ExtendedBlock getNextBlock(List<FsVolumeSpi.BlockIterator> poolIters,
>                                DiskBalancerWorkItem item) {
>       Preconditions.checkNotNull(poolIters);
>       int currentCount = 0;
>       ExtendedBlock block = null;
>       while (block == null && currentCount < poolIters.size()) {
>         currentCount++;
>         int index = poolIndex++ % poolIters.size();
>         FsVolumeSpi.BlockIterator currentPoolIter = poolIters.get(index);
>         block = getBlockToCopy(currentPoolIter, item);
>       }
> {code}
> * Do not "log and throw" errors.  This is an anti-pattern and should be avoided. Log
or throw, but don't do both.  Removed some logging
> * Improved other logging statements
> * Improved the {{hashcode}} method of one of the inner classes.  It was instantiating
a List and performing iteration for every call.  Replace with Eclipse-generated hashcode method.
> * Fixed compiler warnings for deprecated code or code that was not parameterized
> * Fix check style issue



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message