[
https://issues.apache.org/jira/browse/HBASE-18422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16128205#comment-16128205
]
Josh Elser commented on HBASE-18422:
------------------------------------
A few minor suggestions, [~vrodionov]. Could you also try to re-kick the patch
through QA? I know we had a similar problem on your backup&restore merge patch
and eventually got a good run.
{code}
+ private boolean balance() throws InterruptedException, IOException {
+ long startTime = System.currentTimeMillis();
+ long timeout = 60000 ; // 60 sec
+ while (System.currentTimeMillis() - startTime < timeout) {
+ if (UTIL.getHBaseCluster().getMaster().balance()) {
+ return true;
+ }
+ Thread.sleep(100);
+ }
+ return false;
+ }
{code}
Turn this into a {{Predicate}} and use the {{Waiter}} functionality on
{{HBaseTestingUtility}}, please.
{code}
+ // Less two system regions meta and ns
+ regionCount -= 2;
{code}
Thanks for the comment!
{code}
- assert(UTIL.getHBaseCluster().getMaster().balance() == true);
+ assert(balance() == true);
{code}
Can you change this (and the other instances) to use {{assertTrue(balance())}}
instead? It'll generate a much nicer error message upon failure.
{code}
+ if (isMaster(node)) {
+ // Skip Master when calculate load
+ continue;
+ }
{code}
What's the logic behind this? Wouldn't we only want to do this only when Master
isn't carrying regions (which seems like it will be a thing soon)?
{code}
+ Enumeration<ServerName> en = serverMap.keys();
+ while (en.hasMoreElements()) {
+ LOG.debug("server: "+ en.nextElement());
+ }
{code}
Can you wrap the while-loop in a {{if (LOG.isDebugEnabled())}} please? Could
get costly for 100s-1000s of servers.
{code}
+ for (TableName table : assignmentsByTable.keySet()) {
+ Map<ServerName, List<HRegionInfo>> serverMap =
assignmentsByTable.get(table);
{code}
Turn this into {{entrySet()}} to avoid the extra Map lookup? Or maybe you know
a reason why that doesn't actually matter ;)
> Fix TestRegionRebalancing
> -------------------------
>
> Key: HBASE-18422
> URL: https://issues.apache.org/jira/browse/HBASE-18422
> Project: HBase
> Issue Type: Sub-task
> Components: test
> Reporter: Vladimir Rodionov
> Assignee: Vladimir Rodionov
> Attachments: HBASE-18422-v1.patch, HBASE-18422-v2.patch,
> HBASE-18422-v3.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)