hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lei (Eddy) Xu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-9709) DiskBalancer : Add tests for disk balancer using a Mock Mover class.
Date Fri, 11 Mar 2016 00:45:58 GMT

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

Lei (Eddy) Xu commented on HDFS-9709:
-------------------------------------

[~anu] Thanks for providing this patch. 

This patch looks fine to me. Just a few small nits

{code}
// get stuck if we are asked to sleep.
while (sleepInCopyBlocks) {
}
{code}

Maybe put a {{Thread.sleep(0);}} in the loop to step out from CPU run queue? It might give
fairly larger chance for the other threads to run, especially on single CPU machine or VM.

{code}
if (delay > 0) {
try {
Thread.sleep(delay);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
{code}

Please {{LOG}} this exception, and since it is in the test code, can we just throw it again?

Last, while it is not a bug, the code in {{testCancelDiskBalancerPlan}} let me think whether
it might be good to have a {{Builder}} for {{NodePlan}}. 

Also, I am not sure how difficult that would be to change the code, but would it be nice to
let {{DiskBalancer.submitPlan()}} to take NodePlan instead of its json representation as parameters?
So that many code can benefit from a strong type language.  For example, {{submitPlan()}}
takes {{planId}}, {{version}}, {{json}}, {{bandwidth}}, I feel that they can be put into {{class
NodePlan}}, and eliminates some mistakes in the future

> DiskBalancer : Add tests for disk balancer using a Mock Mover class.
> --------------------------------------------------------------------
>
>                 Key: HDFS-9709
>                 URL: https://issues.apache.org/jira/browse/HDFS-9709
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: balancer & mover
>    Affects Versions: HDFS-1312
>            Reporter: Anu Engineer
>            Assignee: Anu Engineer
>             Fix For: HDFS-1312
>
>         Attachments: HDFS-9709-HDFS-1312.001.patch
>
>
> Add tests cases for DiskBalancer using a Mock Mover class. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message