-
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-26714 Introduce path configuration for system coprocessors #4069
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. |
hasPriorityOverride = true; | ||
} | ||
if (classNameToken.length == 3) { |
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.
Shouldn't we set overridePriority
here as well? Or is it supposed to be ignored and use SYSTEM
always? And what if the config definition is invalid, say CLASS_NAME|PATH
? Should we perform some validation?
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 missed that and will fix , thanks for pointing that out
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
i need to check why
|
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.
Thank you for writing this. I saw two nits about a log message and a comment. Looks good to my novice eyes otherwise. Your buildCoprocessorJar()
is a very neat way to create a JAR for tests in HBase; thank you for teaching me.
cl = CoprocessorClassLoader.getClassLoader(path, this.getClass().getClassLoader(), | ||
pathPrefix, conf); | ||
} catch (IOException ioe) { | ||
// if system coprocessors cannot be obtained, we also about the region 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.
I think this should read, we also abort
pathPrefix, conf); | ||
} catch (IOException ioe) { | ||
// if system coprocessors cannot be obtained, we also about the region server | ||
LOG.error("Cannot fetch external System coprocessor class {} with path {}", className, |
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.
Lowercase System
?
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
In fact, I also learnt from the code that |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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 lgtm, left comments with few nits
hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorHost.java
Outdated
Show resolved
Hide resolved
hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorHost.java
Outdated
Show resolved
Hide resolved
if (hasPath) { | ||
String pathPrefix = UUID.randomUUID().toString(); | ||
try { | ||
cl = CoprocessorClassLoader.getClassLoader(path, this.getClass().getClassLoader(), | ||
pathPrefix, conf); | ||
} catch (IOException ioe) { | ||
// if system coprocessors cannot be obtained, we also about the region server | ||
LOG.error("Cannot fetch external System coprocessor class {} with path {}", className, | ||
path); | ||
abortServer(className, ioe); |
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.
Can we move this logic under the original try{} catch{}, so that we don't have multiple condition for "abortServer(className, ioe);"
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 was trying to separate them and throws with different message, so, I think merging them may confuse operators and they won't know it was caused by loading system coprocessor remotely
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.
LOG.error("Cannot fetch external System coprocessor class {} with path {}", className, path);
The error message doesn't seem correct as the class will be fetched(or loaded) in the next step. And I also still believe that as the IOException should already be covering the reason if the path is incorrect, we should merge this try-catch with the other to avoid the redundant code.
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 agreed that the IOException will cover the right stacktrace, and just to clarify that CoprocessorClassLoader.getClassLoader
internally will first check if the given path exist before actually loading the classname from the jar, that's why I split them into two blocks originally and want to tell the operators from logs that the jar file does not exist and it's not only about give coprocessor class does not exist
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.
c49b2c6 has merged the block into a single try-catch, and thanks for your explanation
hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java
Outdated
Show resolved
Hide resolved
hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java
Outdated
Show resolved
Hide resolved
squashed and trying to trigger the precommit tests |
🎊 +1 overall
This message was automatically generated. |
+1 and Thanks for taking care of the review comments. |
🎊 +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. |
2 similar comments
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
No description provided.