-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-25852 Move all the intialization work of LoadBalancer implement… #3248
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
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. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
…ation to initialize method
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
saintstack
left a comment
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.
LG.
Good cleanup.
Nit questions/Comments
| * Set the current cluster status. This allows a LoadBalancer to map host name to a server | ||
| */ | ||
| void setClusterMetrics(ClusterMetrics st); | ||
| void updateClusterMetrics(ClusterMetrics metrics); |
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.
We change the method name because the method is now being used differently? Before we called 'set' once? But now we 'update' continuously during operation? Or was it just always incorrectly named?
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.
We have a background chore called ClusterStatusChore to call this method periodically...
| * <p/> | ||
| * Since 3.0.0, all the balancers will be wrapped inside a {@code RSGroupBasedLoadBalancer}, it will | ||
| * be in charge of the synchronization of balancing and configuration changing, so we do not need to | ||
| * synchronized by ourselves. |
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.
Interesting. Wondering what the rationale for this (Perhaps it later in this patch)
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.
It is because a previous work, where we move rsgroup feature to core hbase instead of using coprocessor.
See HBASE-22514.
| .generate(cluster); | ||
| } | ||
|
|
||
| @RestrictedApi(explanation = "Should only be called in tests", link = "", |
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.
Instead of @VisibleForTests? (I like this annotation)
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, @apurtell proposed to remove the VisibleForTesting annotation and the javadoc for VisibleForTestinng also tells that you should not use this annotation anymore and suggests you to use RestrictedApi.
/**
* Annotates a program element that exists, or is more widely visible than otherwise necessary, only
* for use in test code.
*
* <p><b>Do not use this interface</b> for public or protected declarations: it is a fig leaf for
* bad design, and it does not prevent anyone from using the declaration---and experience has shown
* that they will. If the method breaks the encapsulation of its class, then its internal
* representation will be hard to change. Instead, use <a
* href="http://errorprone.info/bugpattern/RestrictedApiChecker">RestrictedApiChecker</a>, which
* enforces fine-grained visibility policies.
*
* @author Johannes Henkel
*/
@GwtCompatible
public @interface VisibleForTesting {
}
We will enable error prone when building the project in the general check state in pre commit, so if you break the restriction, there will be a compile error, which is much more useful than VisibleForTesting.
nyl3532016
left a comment
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
…ation to initialize method (apache#3248) Signed-off-by: Michael Stack <[email protected]> Signed-off-by: Yulin Niu <[email protected]>
…ation to initialize method (#3248) (#3258) Signed-off-by: Michael Stack <[email protected]> Signed-off-by: Yulin Niu <[email protected]>
…ation to initialize method