You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/01/11 20:54:09 UTC

svn commit: r1432251 - in /hbase/branches/0.94/src: main/java/org/apache/hadoop/hbase/HConstants.java test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java

Author: stack
Date: Fri Jan 11 19:54:08 2013
New Revision: 1432251

URL: http://svn.apache.org/viewvc?rev=1432251&view=rev
Log:
HBASE-7441 Make ClusterManager in IntegrationTestingUtility pluggable

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java
    hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java?rev=1432251&r1=1432250&r2=1432251&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HConstants.java Fri Jan 11 19:54:08 2013
@@ -72,7 +72,10 @@ public final class HConstants {
 
   /** Config for pluggable load balancers */
   public static final String HBASE_MASTER_LOADBALANCER_CLASS = "hbase.master.loadbalancer.class";
-
+  
+  /** Config for pluggable hbase cluster manager */
+  public static final String HBASE_CLUSTER_MANAGER_CLASS = "hbase.it.clustermanager.class";
+  
   /** Cluster is standalone or pseudo-distributed */
   public static final boolean CLUSTER_IS_LOCAL = false;
 

Modified: hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java?rev=1432251&r1=1432250&r2=1432251&view=diff
==============================================================================
--- hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java (original)
+++ hbase/branches/0.94/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java Fri Jan 11 19:54:08 2013
@@ -18,9 +18,10 @@
 
 package org.apache.hadoop.hbase;
 
-import java.io.IOException;
-
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.util.ReflectionUtils;
+
+import java.io.IOException;
 
 /**
  * Facility for <strong>integration/system</strong> tests. This extends {@link HBaseTestingUtility}
@@ -122,7 +123,11 @@ public class IntegrationTestingUtility e
 
   private void createDistributedHBaseCluster() throws IOException {
     Configuration conf = getConfiguration();
-    ClusterManager clusterManager = new HBaseClusterManager();
+    Class<? extends ClusterManager> clusterManagerClass = conf.getClass(
+      HConstants.HBASE_CLUSTER_MANAGER_CLASS, HBaseClusterManager.class,
+      ClusterManager.class);
+    ClusterManager clusterManager = ReflectionUtils.newInstance(
+      clusterManagerClass, conf);
     setHBaseCluster(new DistributedHBaseCluster(conf, clusterManager));
     getHBaseAdmin();
   }