HBASE-24569 Get hostAndWeights in addition using localhost if it is n…#1909
HBASE-24569 Get hostAndWeights in addition using localhost if it is n…#1909bsglz wants to merge 3 commits intoapache:masterfrom
Conversation
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
virajjasani
left a comment
There was a problem hiding this comment.
Left one comment. Small UT to test this is possible?
hbase-server/src/main/java/org/apache/hadoop/hbase/HDFSBlocksDistribution.java
Outdated
Show resolved
Hide resolved
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@Apache9 I believe this looks good to go. Please let me know if you have different opinion. |
|
I do not fully understand the logic here, why it is OK to use localhost if the returned hostAndWeight is null? We will only use the related methods to get hostAndWeight for the local machine? |
Good question, the input host might be other machine in distributed mode, but in that case the hostAndWeights will not use localhost as host name(get from BlockLocation.hosts), so it is ok. |
|
@Apache9 Any more comments? |
I do not get your point... The modified code is like this, no matter what is the host passed in, you will always use localhost to get the hostAndWeight again if the first get returns null? What do you mean by 'but in that case the hostAndWeights will not use localhost as host name'? |
|
The hostAndWeights stores weight of hosts for a region, currently the hosts in special mode has a bit diff, shows below. In local mode, we can not get the weight now, and the code I added could solve it. |
Is this a strong assumption? |
Not strong enough...maybe i can add a mode condition here using "hbase.cluster.distributed", WDYT? |
Can we check whether the given host is the hostname for localhost? Is the operation expensive? |
Seems good idea, let me try. Thanks. |
|
💔 -1 overall
This message was automatically generated. |
2 similar comments
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
In my local env, the code below cost about 1μs~200μs, avg<5μs, much lesser than 1ms. |
…ull in local mode
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
The failure test on jdk11 is TestRegionServerReportForDuty, due to time out, seems unrelated to this PR. |
wchevreuil
left a comment
There was a problem hiding this comment.
Is this relevant for non-prod deployments using local FS only?
Yeah. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
There are not different between build-6 and build-7, but the latter failed on jdk8, seems unrelated to this PR. |
|
🎊 +1 overall
This message was automatically generated. |
|
@Apache9 Ping. |
|
Ping. @Apache9 |
hbase-server/src/main/java/org/apache/hadoop/hbase/HDFSBlocksDistribution.java
Show resolved
Hide resolved
|
Ping. @Apache9 |
…ull in local mode Closes #1909 Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…ull in local mode Closes #1909 Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…ull in local mode Closes apache#1909 Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…ull in local mode Closes apache#1909 Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…ull in local mode