-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-23639 : Moving classes out of hbase-it /test for direct API use of chaos. #1201
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. |
| import java.util.HashSet; | ||
| import java.util.Set; | ||
|
|
||
| @InterfaceAudience.Private |
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 should keep this Public. It would help when you are creating new MonkeyFactory and wants to use default constants like PERIODIC_ACTION1_PERIOD, MOVE_REGIONS_MAX_TIME etc.
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.
By "creating new MonkeyFactory" , i mean creating outside hbase-it , in user's project
virajjasani
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.
One minor suggestion in addition to Mihir's comment
| public class HBaseClusterManager extends Configured implements ClusterManager { | ||
| @InterfaceAudience.Public | ||
| public class HBaseClusterManager extends Configured implements | ||
| org.apache.hadoop.hbase.ClusterManager { |
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: you can import it and then use
|
Overall, looks good |
|
💔 -1 overall
This message was automatically generated. |
busbey
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.
committers please do not merge this. discussion on HBASE-23639.
|
💔 -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. |
|
@apurtell @virajjasani @mihir6692 @busbey , can you take a look at the PR and see if anything else is required here.! |
virajjasani
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 overall, need one confirmation
| import org.apache.hbase.thirdparty.com.google.common.collect.Sets; | ||
| import org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine; | ||
|
|
||
| @InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.CHAOS, HBaseInterfaceAudience.TOOLS}) |
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.
Maybe I missed discussion around including HBaseInterfaceAudience.TOOLS for ChaosMonkeyRunner. Hope this is as per the discussions.
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.
@virajjasani did discussion internally as ChaosMonkeyRunner can be used as tool (can be used from command line), still needed confirmation. waiting from others.
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.
IMHO it should be fine to add TOOLS to ChaosMonkeyRunner.
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
ndimiduk
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.
- Please ensure your git commit and JIRA subjects match. The JIRA seems inappropriately named, given the scope of this change.
- Have you confirmed that existing IT tools still work out of the box after these changes? Is there any automated testing in our CI environment that provides this assurance?
- Do you have an example application that uses these APIs as public? Does it work correctly? Is it still reaching in to access private methods?
hbase-it/pom.xml
Outdated
| <groupId>org.apache.hbase</groupId> | ||
| <artifactId>hbase-zookeeper</artifactId> | ||
| <type>test-jar</type> | ||
| <scope>compile</scope> |
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.
compile is the default scope, no need to mention it.
hbase-it/pom.xml
Outdated
| <dependency> | ||
| <groupId>org.apache.hbase</groupId> | ||
| <artifactId>hbase-server</artifactId> | ||
| <type>test-jar</type> |
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 are there compile scope dependencies on test jars? Is there a plan to move the required code into a src/main/java?
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 I am moving these classes from src/test/java -> src/main/java as discussed with Sean and Andrew that any code under test with an audience and stability annotation is not meaningful and anti-pattern.
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 see that you're moving classes within the hbase-it module. But that's not what I asked about. I'm curious about their transitive dependencies -- do these classes in hbase-it/src/main/java have dependencies on classes in abase-server/src/test/java? Why is it necessary to have dependences on the <type>test-jar</type> for classes that are our part of our API contract?
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 some classes in hbase-it/src/main/java have dependencies on classes present in hbase-server/src/test/java for ex: some DistributedHBaseCluster extends HBaseCluster which is present in hbase-server/src/test/java.
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.
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 dependency graph goes deep, and makes this a non-trivial challenge to unravel. I agree we should be shipping a solid suite of tools for testing HBase and HBase applications. Sadly changing only the leaves of that graph is not sufficient. IMHO, you have to start at the root classes and work out to the leaves. I don't know if that effort is worth it when compared to building a new testing harness from scratch that's designed from the outset to be user-facing.
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.
@ndimiduk I moved the whole hierarchy in src/ on which chaos framework had a dependency, mostly classes are parent classes of IntegrationTestingUtility and DistributedHBaseCluster and their dependencies. Please take a look if this is the right way!!
Thanks.
| * Monkey factory to create a ChaosMonkey that will not need access to ssh. It will not | ||
| * kill any services and it will not perform any restarts. | ||
| */ | ||
| @InterfaceAudience.Private |
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 are the monkey factories private? Is a user not expected to call them directly?
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 MonkeyFactories are mostly expected as a param to ChaosMonkeyRunner and are not used directly, but if you think to make them LimitedPrivate is more helpful, then I'll change this.
| * <p> | ||
| * Chaos monkey can be run from the command line, or can be invoked from integration tests. | ||
| * See {@link org.apache.hadoop.hbase.IntegrationTestIngest} or other integration tests that use | ||
| * See {org.apache.hadoop.hbase.IntegrationTestIngest in hbase-it /test} or other integration tests that use |
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.
Is it intentional to hide the class name? Is this valid java doc?
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.
IntegrationTestIngest is from src/test/java and was inaccessible as ChaosMonkey was moved to src/main/java.
I changed JIRA subject to match with git commit. |
I'm very glad to hear you're able to make progress here. As an alternative to teasing out these APIs, have you considered contributing that |
Yes Definitely! |
|
@lokiore please resolve the conflicts. |
@virajjasani I have resolved all the conflicts |
Looks like some other PR got merged right away will resolve them as well |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
@virajjasani @ndimiduk please take a look, I have resolved all the conflicts. |
|
💔 -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. |
|
AssignmentTestingUtil, HBaseZKTestingUtility, MapReduceTestingShim and the most important HBaseCommonTestingUtility is also being moved to src/main/java/ ? Any chance we can avoid these classes? |
|
@lokiore See queries above? Any chance of landing this one. You've done a load of work on it. |
|
Closing. Open new PR after addressing the outstanding comments. Can refer to this PR in your new one. Thanks. |
No description provided.