[
https://issues.apache.org/jira/browse/HBASE-13706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632632#comment-14632632
]
Jerry He commented on HBASE-13706:
----------------------------------
This is the current 'whitelist' for exemption:
{code}
/**
* If the class being loaded starts with any of these strings, we will skip
* trying to load it from the coprocessor jar and instead delegate
* directly to the parent ClassLoader.
*/
private static final String[] CLASS_PREFIX_EXEMPTIONS = new String[] {
// Java standard library:
"com.sun.",
"launcher.",
"java.",
"javax.",
"org.ietf",
"org.omg",
"org.w3c",
"org.xml",
"sunw.",
// logging
"org.apache.commons.logging",
"org.apache.log4j",
"com.hadoop",
// Hadoop/HBase/ZK:
"org.apache.hadoop",
"org.apache.zookeeper",
};
{code}
My thinking was that "org.apache.hadoop" in the above list happens to include
'org.apache.hadoop.hive', which is a mistake.
But if I want to go deeper and expand "org.apache.hadoop" to whitelist its
relevant subpackages, it gets pretty messy. For example, hadoop-common has
multiple subpackages that are not very uniformly named.
Thinking it a little more, maybe the above list needs to be re-visited?
Is there a real need to exempt Hadoop classes? What is special about hadoop
packages as dependencies? What are the subpackages we really need to exempt?
I can understand why we want to use the parent classloader to load HBase
classes.
Say if a co-processor implementation has to use a different hadoop version,
will it cause trouble on the server side? The co-processor jar bundles the
hadoop jar. The hadoop classes of different version used by the co-processor
would be loaded by CoprocessorClassLoader.
Pardon my ignorance on this.
> CoprocessorClassLoader should not exempt Hive classes
> -----------------------------------------------------
>
> Key: HBASE-13706
> URL: https://issues.apache.org/jira/browse/HBASE-13706
> Project: HBase
> Issue Type: Bug
> Components: Coprocessors
> Affects Versions: 2.0.0, 1.0.1, 1.1.0, 0.98.12
> Reporter: Jerry He
> Assignee: Jerry He
> Priority: Minor
> Fix For: 2.0.0, 0.98.14, 1.0.2, 1.1.2
>
> Attachments: HBASE-13706.patch
>
>
> CoprocessorClassLoader is used to load classes from the coprocessor jar.
> Certain classes are exempt from being loaded by this ClassLoader, which means
> they will be ignored in the coprocessor jar, but loaded from parent classpath
> instead.
> One problem is that we categorically exempt "org.apache.hadoop".
> But it happens that Hive packages start with "org.apache.hadoop".
> There is no reason to exclude hive classes from theCoprocessorClassLoader.
> HBase does not even include Hive jars.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)