-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-26076 Support favoredNodes when do compaction offload #3468
Conversation
🎊 +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 sir, mind help take a look at your convenience. |
🎊 +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. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
...e-server/src/main/java/org/apache/hadoop/hbase/compactionserver/CompactionThreadManager.java
Show resolved
Hide resolved
@@ -344,14 +344,27 @@ private StoreContext initializeStoreContext(ColumnFamilyDescriptor family) throw | |||
} | |||
|
|||
private InetSocketAddress[] getFavoredNodes() { | |||
InetSocketAddress[] favoredNodes = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the code still compile after you remove this line? This is a behavior change? We have a favoredNodes class field in HStore?
private InetSocketAddress[] favoredNodes = null; | ||
|
||
public void setFavoredNodes( | ||
List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> favoredNodes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use HBaseProtos.ServerName?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
||
public void setFavoredNodes( | ||
List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> favoredNodes) { | ||
if (favoredNodes != null && favoredNodes.size() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CollectionUtils.isNotEmpty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
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 mind help take a look at your convenience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1.
Just a simple thing want to double confirm.
if (region.getRegionServerServices() != null) { | ||
favoredNodes = region.getRegionServerServices().getFavoredNodesForRegion( | ||
region.getRegionInfo().getEncodedName()); | ||
return region.getRegionServerServices() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this means, if on a region server, we will get the favored nodes from region server, otherwise, use the one set by compaction server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the logic is like this
1.If we have favoredNodes for region, We use this policy
2.If we not have favoredNodes, we add the regionServer request compaction as favoredNodes when do compact on compaction server, to guarantee locality