hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1331638 - /hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java
Date Fri, 27 Apr 2012 23:54:21 GMT
Author: stack
Date: Fri Apr 27 23:54:21 2012
New Revision: 1331638

URL: http://svn.apache.org/viewvc?rev=1331638&view=rev
Log:
HBASE-5893 Allow spaces in coprocessor conf (aka trim() className)

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java?rev=1331638&r1=1331637&r2=1331638&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/coprocessor/CoprocessorHost.java Fri
Apr 27 23:54:21 2012
@@ -117,15 +117,15 @@ public abstract class CoprocessorHost<E 
   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;
       }



Mime
View raw message