HBASE-5893 Allow spaces in coprocessor conf (aka trim() className)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1331638 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2012-04-27 23:54:21 +00:00
parent f7e3a14850
commit 4e080b0dcb
1 changed files with 6 additions and 6 deletions

View File

@ -117,15 +117,15 @@ public abstract class CoprocessorHost<E extends CoprocessorEnvironment> {
protected void loadSystemCoprocessors(Configuration conf, String confKey) {
Class<?> implClass = null;
// load default coprocessors from configure file
String defaultCPClasses = conf.get(confKey);
if (defaultCPClasses == null || defaultCPClasses.length() == 0)
// load default coprocessors from configure file
String[] defaultCPClasses = conf.getStrings(confKey);
if (defaultCPClasses == null || defaultCPClasses.length == 0)
return;
StringTokenizer st = new StringTokenizer(defaultCPClasses, ",");
int priority = Coprocessor.PRIORITY_SYSTEM;
List<E> configured = new ArrayList<E>();
while (st.hasMoreTokens()) {
String className = st.nextToken();
for (String className : defaultCPClasses) {
className = className.trim();
if (findCoprocessor(className) != null) {
continue;
}