-
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-22874] Canary should not be IA.Public #565
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
public interface CanaryInterface { | ||
|
||
static CanaryInterface create(Configuration conf, ExecutorService executor) { | ||
return new Canary(conf); |
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 don't use the executor?
import java.util.concurrent.ExecutorService; | ||
|
||
@InterfaceAudience.Public | ||
public interface CanaryInterface { |
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.
What do folks think about having the interface be Canary
and the tool be CanaryTool
or CanaryImpl
?
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.
I also thought about this. If we backport this to working branches. In my case it is 1.3. We already have other tools which calls Canary via toolRunner and if I backport this patch to 1.3 then my current code will fail since Canary will be an interface now instead of ToolRunner implementation.
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.
I think when you backport this patch to 1.3 you can also change the code in 1.3 to call CanaryTool instead of Canary? No big problem? CanaryInterface is not a good class name I'd say.
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.
I think when you backport this patch to 1.3 you can also change the code in 1.3 to call CanaryTool instead of Canary?
Wouldn't that be an incompatible change ? In minor upgrades, if we ask downstream projects to change how they invoke public exposed classes. I am just trying to understand the compatibility challenges here. In my company, I can change my downstream project. I am not sure if other people would be fine with it. @Apache9 @busbey Please advise.
@@ -1629,7 +1684,7 @@ public static void main(String[] args) throws Exception { | |||
final Configuration conf = HBaseConfiguration.create(); | |||
|
|||
// Loading the generic options to conf | |||
new GenericOptionsParser(conf, args); | |||
//new GenericOptionsParser(conf, args); |
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.
why aren't we parsing generic options anymore?
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.
This was redundant. We already do parsing in https://github.com/apache/hadoop/blob/branch-2.8/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ToolRunner.java#L70
@@ -843,9 +876,9 @@ public int run(String[] args) throws Exception { | |||
} | |||
} | |||
currentTimeLength = System.currentTimeMillis() - startTime; | |||
if (currentTimeLength > this.timeout) { | |||
if (currentTimeLength > timeout) { |
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.
nit: avoid unrelated style changes like removing the this
variables
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.
I removed bunch of class variables and store them in conf object. I replaced the class variable with method local variable. So I can't use "this" anymore.
Thank you @busbey for your reviews. This is still a WIP patch. I wanted to run all the test once and see if I introduced any regression. Will add unit tests, cleanup code, address your comments in next revision. Hopefully by EOD I should be able to get it to review state. :) |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
import java.util.concurrent.ExecutorService; | ||
|
||
@InterfaceAudience.Public | ||
public interface CanaryInterface { |
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.
I think when you backport this patch to 1.3 you can also change the code in 1.3 to call CanaryTool instead of Canary? No big problem? CanaryInterface is not a good class name I'd say.
* @return the exit code of the Canary tool. | ||
* @throws Exception | ||
*/ | ||
public int runRegionCanary(String[] targets) throws Exception; |
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.
If we want to pass tables here, why not just use TableName as the parameter?
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.
And call it checkRegions?
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.
Sure. Will address in next revision.
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.
If we want to pass tables here, why not just use TableName as the parameter?
The reason to not use TableName is we can pass table names as regular expression also.
* @return the exit code of the Canary tool. | ||
* @throws Exception | ||
*/ | ||
public int runRegionServerCanary(String[] targets) throws Exception; |
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.
Ditto. And call it checkRegionServers?
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.
Sure. Will address in next revision.
* @return the exit code of the Canary tool. | ||
* @throws Exception | ||
*/ | ||
public int runZookeeperCanary() throws Exception; |
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.
Call it checkZooKeeper?
/** | ||
* Runs Canary in Zookeeper mode. | ||
* @return the exit code of the Canary tool. | ||
* @throws Exception |
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.
nit: remove the empty throws.
* Runs Canary in Region server mode. | ||
* @param targets -- list of monitor tables. | ||
* @return the exit code of the Canary tool. | ||
* @throws Exception |
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.
nit: remove the empty throws.
* Run Canary in Region mode. | ||
* @param targets -- list of monitor tables. | ||
* @return the exit code of the Canary tool. | ||
* @throws Exception |
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.
nit: remove the empty throws.
💔 -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. |
It usually means a commit got pushed to master that says it's fixed. I don't see anything obvious but haven't gotten to look much. |
I don't see anything in the git log that obviously relates to this PR. |
Things I changed in this PR:
Outstanding questions that I need help from community.
Can we just create 1 conf property for usage via API. We still will support all 3 arguments via ToolRunner interface.
@busbey @Apache9 @gjacoby126 @apurtell please review.