hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1334314 [4/4] - in /hbase/trunk: conf/ security/src/main/java/org/apache/hadoop/hbase/security/ src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ src/main/java/org/apache/hadoop/hbase/ src/main/java/org/apache/hadoop/hbase/client/ ...
Date Sat, 05 May 2012 04:22:54 GMT
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionThriftServer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionThriftServer.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionThriftServer.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionThriftServer.java Sat May  5 04:22:52 2012
@@ -57,14 +57,14 @@ public class HRegionThriftServer extends
 
   public static final Log LOG = LogFactory.getLog(HRegionThriftServer.class);
 
-  private final RegionServer rs;
+  private final HRegionServer rs;
   private final ThriftServerRunner serverRunner;
 
   /**
    * Create an instance of the glue object that connects the
    * RegionServer with the standard ThriftServer implementation
    */
-  HRegionThriftServer(RegionServer regionServer, Configuration conf)
+  HRegionThriftServer(HRegionServer regionServer, Configuration conf)
       throws IOException {
     super("Region Thrift Server");
     this.rs = regionServer;

Modified: hbase/trunk/src/main/protobuf/Admin.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/protobuf/Admin.proto?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/main/protobuf/Admin.proto (original)
+++ hbase/trunk/src/main/protobuf/Admin.proto Sat May  5 04:22:52 2012
@@ -174,7 +174,6 @@ message ReplicateWALEntryRequest {
 message ReplicateWALEntryResponse {
 }
 
-// Replacement for rollHLogWriter in HRegionInterface 
 message RollWALWriterRequest {
 }
 
@@ -193,8 +192,13 @@ message StopServerResponse {
 message GetServerInfoRequest {
 }
 
-message GetServerInfoResponse {
+message ServerInfo {
   required ServerName serverName = 1;
+  optional uint32 webuiPort = 2;
+}
+
+message GetServerInfoResponse {
+  required ServerInfo serverInfo = 1;
 }
 
 service AdminService {

Modified: hbase/trunk/src/main/protobuf/RPC.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/protobuf/RPC.proto?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/main/protobuf/RPC.proto (original)
+++ hbase/trunk/src/main/protobuf/RPC.proto Sat May  5 04:22:52 2012
@@ -20,7 +20,7 @@
  * Specification of (unsecure) HBase RPC:
  *
  * Client needs to set up a connection first to a server serving a certain
- * HBase protocol (like HRegionInterface). Once the connection is set up, the 
+ * HBase protocol (like ClientProtocol). Once the connection is set up, the 
  * client and server communicates on that channel for RPC requests/responses.
  * The sections below describe the flow. 
  * 
@@ -58,7 +58,7 @@ message ConnectionHeader {
   /** Protocol name for next rpc layer
    * the client created a proxy with this protocol name
    */
-  optional string protocol = 2 [default = "org.apache.hadoop.hbase.ipc.HRegionInterface"];
+  optional string protocol = 2 [default = "org.apache.hadoop.hbase.client.ClientProtocol"];
 }
 
 

Modified: hbase/trunk/src/main/resources/hbase-default.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/resources/hbase-default.xml?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/main/resources/hbase-default.xml (original)
+++ hbase/trunk/src/main/resources/hbase-default.xml Sat May  5 04:22:52 2012
@@ -109,13 +109,6 @@
     </description>
   </property>
   <property>
-    <name>hbase.regionserver.class</name>
-    <value>org.apache.hadoop.hbase.ipc.HRegionInterface</value>
-    <description>The RegionServer interface to use.
-    Used by the client opening proxy to remote region server.
-    </description>
-  </property>
-  <property>
     <name>hbase.client.pause</name>
     <value>1000</value>
     <description>General client pause value.  Used mostly as value to wait

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestDrainingServer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestDrainingServer.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestDrainingServer.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestDrainingServer.java Sat May  5 04:22:52 2012
@@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.master.HMaster;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.FSUtils;
@@ -80,7 +81,7 @@ public class TestDrainingServer {
     MiniHBaseCluster cluster = TEST_UTIL.getMiniHBaseCluster();
     for (int i = 0; i < cluster.getRegionServerThreads().size(); i++) {
       HRegionServer hrs = cluster.getRegionServer(i);
-      Assert.assertFalse(hrs.getOnlineRegions().isEmpty());
+      Assert.assertFalse(ProtobufUtil.getOnlineRegions(hrs).isEmpty());
     }
   }
 
@@ -128,7 +129,7 @@ public class TestDrainingServer {
       final int regionsOnDrainingServer =
         drainingServer.getNumberOfOnlineRegions();
       Assert.assertTrue(regionsOnDrainingServer > 0);
-      List<HRegionInfo> hris = drainingServer.getOnlineRegions();
+      List<HRegionInfo> hris = ProtobufUtil.getOnlineRegions(drainingServer);
       for (HRegionInfo hri : hris) {
         // Pass null and AssignmentManager will chose a random server BUT it
         // should exclude draining servers.

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestGlobalMemStoreSize.java Sat May  5 04:22:52 2012
@@ -28,6 +28,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -81,7 +82,7 @@ public class TestGlobalMemStoreSize {
 
     for (HRegionServer server : getOnlineRegionServers()) {
       long globalMemStoreSize = 0;
-      for (HRegionInfo regionInfo : server.getOnlineRegions()) {
+      for (HRegionInfo regionInfo : ProtobufUtil.getOnlineRegions(server)) {
         globalMemStoreSize += 
           server.getFromOnlineRegions(regionInfo.getEncodedName()).
           getMemstoreSize().get();
@@ -96,7 +97,7 @@ public class TestGlobalMemStoreSize {
       LOG.info("Starting flushes on " + server.getServerName() +
         ", size=" + server.getRegionServerAccounting().getGlobalMemstoreSize());
 
-      for (HRegionInfo regionInfo : server.getOnlineRegions()) {
+      for (HRegionInfo regionInfo : ProtobufUtil.getOnlineRegions(server)) {
         HRegion r = server.getFromOnlineRegions(regionInfo.getEncodedName());
         flush(r, server);
       }
@@ -111,7 +112,7 @@ public class TestGlobalMemStoreSize {
       if (size > 0) {
         // If size > 0, see if its because the meta region got edits while
         // our test was running....
-        for (HRegionInfo regionInfo : server.getOnlineRegions()) {
+        for (HRegionInfo regionInfo : ProtobufUtil.getOnlineRegions(server)) {
           HRegion r = server.getFromOnlineRegions(regionInfo.getEncodedName());
           long l = r.getMemstoreSize().longValue();
           if (l > 0) {
@@ -148,7 +149,7 @@ public class TestGlobalMemStoreSize {
   private int getRegionCount() throws IOException {
     int total = 0;
     for (HRegionServer server : getOnlineRegionServers()) {
-      total += server.getOnlineRegions().size();
+      total += ProtobufUtil.getOnlineRegions(server).size();
     }
     return total;
   }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/TestRegionRebalancing.java Sat May  5 04:22:52 2012
@@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.catalog.C
 import org.apache.hadoop.hbase.catalog.MetaReader;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.JVMClusterUtil;
@@ -135,7 +136,7 @@ public class TestRegionRebalancing {
   private int getRegionCount() throws IOException {
     int total = 0;
     for (HRegionServer server : getOnlineRegionServers()) {
-      total += server.getOnlineRegions().size();
+      total += ProtobufUtil.getOnlineRegions(server).size();
     }
     return total;
   }
@@ -167,11 +168,11 @@ public class TestRegionRebalancing {
         + ", up border: " + avgLoadPlusSlop + "; attempt: " + i);
 
       for (HRegionServer server : servers) {
-        int serverLoad = server.getOnlineRegions().size();
+        int serverLoad = ProtobufUtil.getOnlineRegions(server).size();
         LOG.debug(server.getServerName() + " Avg: " + avg + " actual: " + serverLoad);
         if (!(avg > 2.0 && serverLoad <= avgLoadPlusSlop
             && serverLoad >= avgLoadMinusSlop)) {
-          for (HRegionInfo hri : server.getOnlineRegions()) {
+          for (HRegionInfo hri : ProtobufUtil.getOnlineRegions(server)) {
             if (hri.isMetaRegion() || hri.isRootRegion()) serverLoad--;
             // LOG.debug(hri.getRegionNameAsString());
           }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTracker.java Sat May  5 04:22:52 2012
@@ -50,7 +50,6 @@ import org.apache.hadoop.hbase.client.HC
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.RetriesExhaustedException;
 import org.apache.hadoop.hbase.client.ServerCallable;
-import org.apache.hadoop.hbase.ipc.HRegionInterface;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoRequest;
 import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse;
@@ -454,8 +453,9 @@ public class TestCatalogTracker {
    * @return Mock up a connection that returns a {@link Configuration} when
    * {@link HConnection#getConfiguration()} is called, a 'location' when
    * {@link HConnection#getRegionLocation(byte[], byte[], boolean)} is called,
-   * and that returns the passed {@link HRegionInterface} instance when
-   * {@link HConnection#getHRegionConnection(String, int)}
+   * and that returns the passed {@link AdminProtocol} instance when
+   * {@link HConnection#getAdmin(String, int)} is called, returns the passed
+   * {@link ClientProtocol} instance when {@link HConnection#getClient(String, int)}
    * is called (Be sure call
    * {@link HConnectionManager#deleteConnection(org.apache.hadoop.conf.Configuration, boolean)}
    * when done with this mocked Connection.

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/HConnectionTestingUtility.java Sat May  5 04:22:52 2012
@@ -28,7 +28,6 @@ import org.apache.hadoop.hbase.client.Ad
 import org.apache.hadoop.hbase.client.ClientProtocol;
 import org.apache.hadoop.hbase.client.HConnectionManager.HConnectionImplementation;
 import org.apache.hadoop.hbase.client.HConnectionManager.HConnectionKey;
-import org.apache.hadoop.hbase.ipc.HRegionInterface;
 import org.mockito.Mockito;
 
 /**
@@ -86,8 +85,9 @@ public class HConnectionTestingUtility {
    * @return Mock up a connection that returns a {@link Configuration} when
    * {@link HConnection#getConfiguration()} is called, a 'location' when
    * {@link HConnection#getRegionLocation(byte[], byte[], boolean)} is called,
-   * and that returns the passed {@link HRegionInterface} instance when
-   * {@link HConnection#getHRegionConnection(String, int)}
+   * and that returns the passed {@link AdminProtocol} instance when
+   * {@link HConnection#getAdmin(String, int)} is called, returns the passed
+   * {@link ClientProtocol} instance when {@link HConnection#getClient(String, int)}
    * is called (Be sure call
    * {@link HConnectionManager#deleteConnection(org.apache.hadoop.conf.Configuration, boolean)}
    * when done with this mocked Connection.

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java Sat May  5 04:22:52 2012
@@ -46,6 +46,7 @@ import org.apache.hadoop.hbase.executor.
 import org.apache.hadoop.hbase.master.AssignmentManager;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.MasterServices;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.wal.HLogUtilsForTests;
@@ -1224,7 +1225,7 @@ public class TestAdmin {
 
     HRegionInfo info = null;
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
-    List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
+    List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(rs);
     for (HRegionInfo regionInfo : onlineRegions) {
       if (!regionInfo.isMetaTable()) {
         info = regionInfo;
@@ -1233,7 +1234,7 @@ public class TestAdmin {
       }
     }
     Thread.sleep(1000);
-    onlineRegions = rs.getOnlineRegions();
+    onlineRegions = ProtobufUtil.getOnlineRegions(rs);
     assertFalse("The region should not be present in online regions list.",
         onlineRegions.contains(info));
   }
@@ -1245,7 +1246,7 @@ public class TestAdmin {
 
     HRegionInfo info = null;
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
-    List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
+    List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(rs);
     for (HRegionInfo regionInfo : onlineRegions) {
       if (!regionInfo.isMetaTable()) {
         if (regionInfo.getRegionNameAsString().contains("TestHBACloseRegion1")) {
@@ -1259,7 +1260,7 @@ public class TestAdmin {
         }
       }
     }
-    onlineRegions = rs.getOnlineRegions();
+    onlineRegions = ProtobufUtil.getOnlineRegions(rs);
     assertTrue("The region should be present in online regions list.",
         onlineRegions.contains(info));
   }
@@ -1271,7 +1272,7 @@ public class TestAdmin {
 
     HRegionInfo info = null;
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
-    List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
+    List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(rs);
     for (HRegionInfo regionInfo : onlineRegions) {
       if (!regionInfo.isMetaTable()) {
 
@@ -1283,11 +1284,11 @@ public class TestAdmin {
       }
     }
 
-    boolean isInList = rs.getOnlineRegions().contains(info);
+    boolean isInList = ProtobufUtil.getOnlineRegions(rs).contains(info);
     long timeout = System.currentTimeMillis() + 2000;
     while ((System.currentTimeMillis() < timeout) && (isInList)) {
       Thread.sleep(100);
-      isInList = rs.getOnlineRegions().contains(info);
+      isInList = ProtobufUtil.getOnlineRegions(rs).contains(info);
     }
 
     assertFalse("The region should not be present in online regions list.",
@@ -1302,7 +1303,7 @@ public class TestAdmin {
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
 
     try {
-      List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
+      List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(rs);
       for (HRegionInfo regionInfo : onlineRegions) {
         if (!regionInfo.isMetaTable()) {
           if (regionInfo.getRegionNameAsString()
@@ -1326,7 +1327,7 @@ public class TestAdmin {
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
 
     try {
-      List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
+      List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(rs);
       for (HRegionInfo regionInfo : onlineRegions) {
         if (!regionInfo.isMetaTable()) {
           if (regionInfo.getRegionNameAsString()
@@ -1349,7 +1350,7 @@ public class TestAdmin {
     HRegionInfo info = null;
     HRegionServer rs = TEST_UTIL.getRSForFirstRegionInTable(TABLENAME);
 
-    List<HRegionInfo> onlineRegions = rs.getOnlineRegions();
+    List<HRegionInfo> onlineRegions = ProtobufUtil.getOnlineRegions(rs);
     for (HRegionInfo regionInfo : onlineRegions) {
       if (!regionInfo.isMetaTable()) {
         if (regionInfo.getRegionNameAsString().contains("TestHBACloseRegion4")) {
@@ -1363,7 +1364,7 @@ public class TestAdmin {
         }
       }
     }
-    onlineRegions = rs.getOnlineRegions();
+    onlineRegions = ProtobufUtil.getOnlineRegions(rs);
     assertTrue("The region should be present in online regions list.",
         onlineRegions.contains(info));
   }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/client/TestMultiParallel.java Sat May  5 04:22:52 2012
@@ -28,6 +28,7 @@ import java.util.concurrent.ThreadPoolEx
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.*;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.JVMClusterUtil;
 import org.junit.AfterClass;
@@ -260,7 +261,7 @@ public class TestMultiParallel {
     Assert.assertEquals("Server count=" + count + ", abort=" + doAbort,
       (doAbort ? 1 : 2), count);
     for (JVMClusterUtil.RegionServerThread t: liveRSs) {
-      int regions = t.getRegionServer().getOnlineRegions().size();
+      int regions = ProtobufUtil.getOnlineRegions(t.getRegionServer()).size();
       Assert.assertTrue("Count of regions=" + regions, regions > 10);
     }
     table.close();

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java Sat May  5 04:22:52 2012
@@ -40,6 +40,7 @@ import org.apache.hadoop.hbase.client.HT
 import org.apache.hadoop.hbase.master.AssignmentManager;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.MasterCoprocessorHost;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.AfterClass;
@@ -684,7 +685,7 @@ public class TestMasterObserver {
     // move half the open regions from RS 0 to RS 1
     HRegionServer rs = cluster.getRegionServer(0);
     byte[] destRS = Bytes.toBytes(cluster.getRegionServer(1).getServerName().toString());
-    List<HRegionInfo> openRegions = rs.getOnlineRegions();
+    List<HRegionInfo> openRegions = ProtobufUtil.getOnlineRegions(rs);
     int moveCnt = openRegions.size()/2;
     for (int i=0; i<moveCnt; i++) {
       HRegionInfo info = openRegions.get(i);

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverInterface.java Sat May  5 04:22:52 2012
@@ -52,6 +52,7 @@ import org.apache.hadoop.hbase.client.Re
 import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.RowMutations;
 import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.InternalScanner;
 import org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost;
@@ -451,7 +452,7 @@ public class TestRegionObserverInterface
                                   Object value[]) throws IOException {
     try {
       for (JVMClusterUtil.RegionServerThread t : cluster.getRegionServerThreads()) {
-        for (HRegionInfo r : t.getRegionServer().getOnlineRegions()) {
+        for (HRegionInfo r : ProtobufUtil.getOnlineRegions(t.getRegionServer())) {
           if (!Arrays.equals(r.getTableName(), tableName)) {
             continue;
           }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/mapreduce/TestLoadIncrementalHFilesSplitRecovery.java Sat May  5 04:22:52 2012
@@ -48,6 +48,7 @@ import org.apache.hadoop.hbase.client.HT
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.TestHRegionServerBulkLoad;
@@ -153,10 +154,10 @@ public class TestLoadIncrementalHFilesSp
       HRegionServer hrs = util.getRSForFirstRegionInTable(Bytes
           .toBytes(table));
 
-      for (HRegionInfo hri : hrs.getOnlineRegions()) {
+      for (HRegionInfo hri : ProtobufUtil.getOnlineRegions(hrs)) {
         if (Bytes.equals(hri.getTableName(), Bytes.toBytes(table))) {
           // splitRegion doesn't work if startkey/endkey are null
-          hrs.splitRegion(hri, rowkey(ROWCOUNT / 2)); // hard code split
+          ProtobufUtil.split(hrs, hri, rowkey(ROWCOUNT / 2)); // hard code split
         }
       }
 
@@ -164,7 +165,7 @@ public class TestLoadIncrementalHFilesSp
       int regions;
       do {
         regions = 0;
-        for (HRegionInfo hri : hrs.getOnlineRegions()) {
+        for (HRegionInfo hri : ProtobufUtil.getOnlineRegions(hrs)) {
           if (Bytes.equals(hri.getTableName(), Bytes.toBytes(table))) {
             regions++;
           }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java Sat May  5 04:22:52 2012
@@ -47,6 +47,7 @@ import org.apache.hadoop.hbase.*;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.master.SplitLogManager.TaskBatch;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.wal.HLog;
@@ -129,7 +130,7 @@ public class TestDistributedLogSplitting
     HRegionServer hrs = null;
     for (int i = 0; i < NUM_RS; i++) {
       hrs = rsts.get(i).getRegionServer();
-      regions = hrs.getOnlineRegions();
+      regions = ProtobufUtil.getOnlineRegions(hrs);
       if (regions.size() != 0) break;
     }
     final Path logDir = new Path(rootdir, HLog.getHLogDirectoryName(hrs
@@ -189,7 +190,7 @@ public class TestDistributedLogSplitting
 
     installTable(new ZooKeeperWatcher(conf, "table-creation", null),
         "table", "family", 40);
-    makeHLog(hrs.getWAL(), hrs.getOnlineRegions(), "table",
+    makeHLog(hrs.getWAL(), ProtobufUtil.getOnlineRegions(hrs), "table",
         NUM_LOG_LINES, 100);
 
     new Thread() {
@@ -378,7 +379,7 @@ public class TestDistributedLogSplitting
 
     for (RegionServerThread rst : rsts) {
       HRegionServer hrs = rst.getRegionServer();
-      List<HRegionInfo> hris = hrs.getOnlineRegions();
+      List<HRegionInfo> hris = ProtobufUtil.getOnlineRegions(hrs);
       for (HRegionInfo hri : hris) {
         if (hri.isMetaTable()) {
           continue;
@@ -459,7 +460,7 @@ public class TestDistributedLogSplitting
       throws IOException {
     NavigableSet<String> online = new TreeSet<String>();
     for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) {
-      for (HRegionInfo region : rst.getRegionServer().getOnlineRegions()) {
+      for (HRegionInfo region : ProtobufUtil.getOnlineRegions(rst.getRegionServer())) {
         online.add(region.getRegionNameAsString());
       }
     }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java Sat May  5 04:22:52 2012
@@ -38,6 +38,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.*;
 import org.apache.hadoop.hbase.executor.EventHandler.EventType;
 import org.apache.hadoop.hbase.master.AssignmentManager.RegionState;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -311,7 +312,7 @@ public class TestMasterFailover {
     region = enabledRegions.remove(0);
     regionsThatShouldBeOnline.add(region);
     ZKAssign.createNodeOffline(zkw, region, serverName);
-    hrs.openRegion(region);
+    ProtobufUtil.openRegion(hrs, region);
     while (true) {
       byte [] bytes = ZKAssign.getData(zkw, region.getEncodedName());
       RegionTransition rt = RegionTransition.parseFrom(bytes);
@@ -325,7 +326,7 @@ public class TestMasterFailover {
     region = disabledRegions.remove(0);
     regionsThatShouldBeOffline.add(region);
     ZKAssign.createNodeOffline(zkw, region, serverName);
-    hrs.openRegion(region);
+    ProtobufUtil.openRegion(hrs, region);
     while (true) {
       byte [] bytes = ZKAssign.getData(zkw, region.getEncodedName());
       RegionTransition rt = RegionTransition.parseFrom(bytes);
@@ -361,7 +362,7 @@ public class TestMasterFailover {
     Set<HRegionInfo> onlineRegions = new TreeSet<HRegionInfo>();
     for (JVMClusterUtil.RegionServerThread rst :
       cluster.getRegionServerThreads()) {
-      onlineRegions.addAll(rst.getRegionServer().getOnlineRegions());
+      onlineRegions.addAll(ProtobufUtil.getOnlineRegions(rst.getRegionServer()));
     }
 
     // Now, everything that should be online should be online
@@ -671,7 +672,7 @@ public class TestMasterFailover {
     region = enabledRegions.remove(0);
     regionsThatShouldBeOnline.add(region);
     ZKAssign.createNodeOffline(zkw, region, deadServerName);
-    hrsDead.openRegion(region);
+    ProtobufUtil.openRegion(hrsDead, region);
     while (true) {
       byte [] bytes = ZKAssign.getData(zkw, region.getEncodedName());
       RegionTransition rt = RegionTransition.parseFrom(bytes);
@@ -687,7 +688,7 @@ public class TestMasterFailover {
     region = disabledRegions.remove(0);
     regionsThatShouldBeOffline.add(region);
     ZKAssign.createNodeOffline(zkw, region, deadServerName);
-    hrsDead.openRegion(region);
+    ProtobufUtil.openRegion(hrsDead, region);
     while (true) {
       byte [] bytes = ZKAssign.getData(zkw, region.getEncodedName());
       RegionTransition rt = RegionTransition.parseFrom(bytes);
@@ -707,7 +708,7 @@ public class TestMasterFailover {
     region = enabledRegions.remove(0);
     regionsThatShouldBeOnline.add(region);
     ZKAssign.createNodeOffline(zkw, region, deadServerName);
-    hrsDead.openRegion(region);
+    ProtobufUtil.openRegion(hrsDead, region);
     while (true) {
       byte [] bytes = ZKAssign.getData(zkw, region.getEncodedName());
       RegionTransition rt = RegionTransition.parseFrom(bytes);
@@ -725,7 +726,7 @@ public class TestMasterFailover {
     region = disabledRegions.remove(0);
     regionsThatShouldBeOffline.add(region);
     ZKAssign.createNodeOffline(zkw, region, deadServerName);
-    hrsDead.openRegion(region);
+    ProtobufUtil.openRegion(hrsDead, region);
     while (true) {
       byte [] bytes = ZKAssign.getData(zkw, region.getEncodedName());
       RegionTransition rt = RegionTransition.parseFrom(bytes);
@@ -819,7 +820,7 @@ public class TestMasterFailover {
     for (JVMClusterUtil.RegionServerThread rst :
         cluster.getRegionServerThreads()) {
       try {
-        onlineRegions.addAll(rst.getRegionServer().getOnlineRegions());
+        onlineRegions.addAll(ProtobufUtil.getOnlineRegions(rst.getRegionServer()));
       } catch (org.apache.hadoop.hbase.regionserver.RegionServerStoppedException e) {
         LOG.info("Got RegionServerStoppedException", e);
       }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMasterRestartAfterDisablingTable.java Sat May  5 04:22:52 2012
@@ -33,6 +33,7 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.hbase.*;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
@@ -132,7 +133,7 @@ public class TestMasterRestartAfterDisab
       throws IOException {
     NavigableSet<String> online = new TreeSet<String>();
     for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) {
-      for (HRegionInfo region : rst.getRegionServer().getOnlineRegions()) {
+      for (HRegionInfo region : ProtobufUtil.getOnlineRegions(rst.getRegionServer())) {
         online.add(region.getRegionNameAsString());
       }
     }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestRollingRestart.java Sat May  5 04:22:52 2012
@@ -32,6 +32,7 @@ import org.apache.commons.logging.LogFac
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.*;
 import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
@@ -340,7 +341,7 @@ public class  TestRollingRestart {
   private RegionServerThread getServerHosting(MiniHBaseCluster cluster,
       HRegionInfo region) throws IOException {
     for (RegionServerThread rst : cluster.getRegionServerThreads()) {
-      if (rst.getRegionServer().getOnlineRegions().contains(region)) {
+      if (ProtobufUtil.getOnlineRegions(rst.getRegionServer()).contains(region)) {
         return rst;
       }
     }
@@ -386,7 +387,7 @@ public class  TestRollingRestart {
       throws IOException {
     NavigableSet<String> online = new TreeSet<String>();
     for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) {
-      for (HRegionInfo region : rst.getRegionServer().getOnlineRegions()) {
+      for (HRegionInfo region : ProtobufUtil.getOnlineRegions(rst.getRegionServer())) {
         online.add(region.getRegionNameAsString());
       }
     }
@@ -398,7 +399,7 @@ public class  TestRollingRestart {
     NavigableSet<String> online = new TreeSet<String>();
     NavigableSet<String> doubled = new TreeSet<String>();
     for (RegionServerThread rst : cluster.getLiveRegionServerThreads()) {
-      for (HRegionInfo region : rst.getRegionServer().getOnlineRegions()) {
+      for (HRegionInfo region : ProtobufUtil.getOnlineRegions(rst.getRegionServer())) {
         if(!online.add(region.getRegionNameAsString())) {
           doubled.add(region.getRegionNameAsString());
         }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java Sat May  5 04:22:52 2012
@@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.executor.
 import org.apache.hadoop.hbase.executor.EventHandler.EventHandlerListener;
 import org.apache.hadoop.hbase.executor.EventHandler.EventType;
 import org.apache.hadoop.hbase.master.handler.TotesHRegionInfo;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
@@ -107,7 +108,7 @@ public class TestZKBasedOpenCloseRegion 
     int rsIdx = 0;
     HRegionServer regionServer =
       TEST_UTIL.getHBaseCluster().getRegionServer(rsIdx);
-    HRegionInfo hri = getNonMetaRegion(regionServer.getOnlineRegions());
+    HRegionInfo hri = getNonMetaRegion(ProtobufUtil.getOnlineRegions(regionServer));
     LOG.debug("Asking RS to close region " + hri.getRegionNameAsString());
 
     AtomicBoolean closeEventProcessed = new AtomicBoolean(false);
@@ -242,7 +243,7 @@ public class TestZKBasedOpenCloseRegion 
         cluster.getLiveRegionServerThreads().get(0).getRegionServer();
     HRegionServer hr1 =
         cluster.getLiveRegionServerThreads().get(1).getRegionServer();
-    HRegionInfo hri = getNonMetaRegion(hr0.getOnlineRegions());
+    HRegionInfo hri = getNonMetaRegion(ProtobufUtil.getOnlineRegions(hr0));
 
     // fake that hr1 is processing the region
     hr1.getRegionsInTransitionInRS().putIfAbsent(hri.getEncodedNameAsBytes(), true);
@@ -266,7 +267,7 @@ public class TestZKBasedOpenCloseRegion 
     reopenEventProcessed.set(false);
     
     // now try moving a region when there is no region in transition.
-    hri = getNonMetaRegion(hr1.getOnlineRegions());
+    hri = getNonMetaRegion(ProtobufUtil.getOnlineRegions(hr1));
 
     openListener =
       new ReopenEventListener(hri.getRegionNameAsString(),
@@ -295,7 +296,7 @@ public class TestZKBasedOpenCloseRegion 
 
     int rsIdx = 0;
     HRegionServer regionServer = TEST_UTIL.getHBaseCluster().getRegionServer(rsIdx);
-    HRegionInfo hri = getNonMetaRegion(regionServer.getOnlineRegions());
+    HRegionInfo hri = getNonMetaRegion(ProtobufUtil.getOnlineRegions(regionServer));
     LOG.debug("Asking RS to close region " + hri.getRegionNameAsString());
 
     AtomicBoolean closeEventProcessed = new AtomicBoolean(false);
@@ -327,7 +328,7 @@ public class TestZKBasedOpenCloseRegion 
     Whitebox.setInternalState(regionServer, "tableDescriptors", htd);
     Mockito.doThrow(new IOException()).when(htd).get((byte[]) Mockito.any());
     try {
-      regionServer.openRegion(REGIONINFO);
+      ProtobufUtil.openRegion(regionServer, REGIONINFO);
       fail("It should throw IOException ");
     } catch (IOException e) {
     }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestEndToEndSplitTransaction.java Sat May  5 04:22:52 2012
@@ -30,6 +30,9 @@ import org.apache.hadoop.hbase.client.HC
 import org.apache.hadoop.hbase.client.HConnectionManager;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.protobuf.RequestConverter;
+import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanRequest;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.PairOfSameType;
 import org.junit.AfterClass;
@@ -37,6 +40,8 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import com.google.protobuf.ServiceException;
+
 @Category(LargeTests.class)
 public class TestEndToEndSplitTransaction {
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
@@ -119,8 +124,14 @@ public class TestEndToEndSplitTransactio
       byte[] regionName = con.relocateRegion(tableName, row).getRegionInfo()
           .getRegionName();
       // get and scan should now succeed without exception
-      server.get(regionName, new Get(row));
-      server.openScanner(regionName, new Scan(row));
+      ProtobufUtil.get(server, regionName, new Get(row));
+      ScanRequest scanRequest = RequestConverter.buildScanRequest(
+        regionName, new Scan(row), 1, true);
+      try {
+        server.scan(null, scanRequest);
+      } catch (ServiceException se) {
+        throw ProtobufUtil.getRemoteException(se);
+      }
     } catch (IOException x) {
       return false;
     }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestRSStatusServlet.java Sat May  5 04:22:52 2012
@@ -25,11 +25,13 @@ import java.util.List;
 
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.HServerAddress;
-import org.apache.hadoop.hbase.HServerInfo;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.SmallTests;
+import org.apache.hadoop.hbase.protobuf.ResponseConverter;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetOnlineRegionRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetServerInfoRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetServerInfoResponse;
 import org.apache.hadoop.hbase.regionserver.metrics.RegionServerMetrics;
 import org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmpl;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -41,6 +43,8 @@ import org.junit.experimental.categories
 import org.mockito.Mockito;
 
 import com.google.common.collect.Lists;
+import com.google.protobuf.RpcController;
+import com.google.protobuf.ServiceException;
 
 /**
  * Tests for the region server status page and its template.
@@ -52,24 +56,22 @@ public class TestRSStatusServlet {
   static final int FAKE_IPC_PORT = 1585;
   static final int FAKE_WEB_PORT = 1586;
   
-  @SuppressWarnings("deprecation")
-  private final HServerAddress fakeAddress =
-    new HServerAddress("localhost", FAKE_IPC_PORT);
-  @SuppressWarnings("deprecation")
-  private final HServerInfo fakeInfo =
-    new HServerInfo(fakeAddress, FAKE_WEB_PORT);
+  private final ServerName fakeServerName =
+    new ServerName("localhost", FAKE_IPC_PORT, 11111);
+  private final GetServerInfoResponse fakeResponse =
+    ResponseConverter.buildGetServerInfoResponse(fakeServerName, FAKE_WEB_PORT);
   private final RegionServerMetrics metrics =
     new RegionServerMetrics();
   private final ServerName fakeMasterAddress =
     new ServerName("localhost", 60010, 1212121212);
-  
-  @SuppressWarnings("deprecation")
+
   @Before
-  public void setupBasicMocks() throws IOException {
+  public void setupBasicMocks() throws IOException, ServiceException {
     rs = Mockito.mock(HRegionServer.class);
     Mockito.doReturn(HBaseConfiguration.create())
       .when(rs).getConfiguration();
-    Mockito.doReturn(fakeInfo).when(rs).getHServerInfo();
+    Mockito.doReturn(fakeResponse).when(rs).getServerInfo(
+      (RpcController)Mockito.any(), (GetServerInfoRequest)Mockito.any());
     Mockito.doReturn(metrics).when(rs).getMetrics();
 
     // Fake ZKW
@@ -84,18 +86,20 @@ public class TestRSStatusServlet {
   }
   
   @Test
-  public void testBasic() throws IOException {
+  public void testBasic() throws IOException, ServiceException {
     new RSStatusTmpl().render(new StringWriter(), rs);
   }
   
   @Test
-  public void testWithRegions() throws IOException {
+  public void testWithRegions() throws IOException, ServiceException {
     HTableDescriptor htd = new HTableDescriptor("mytable");
     List<HRegionInfo> regions = Lists.newArrayList(
         new HRegionInfo(htd.getName(), Bytes.toBytes("a"), Bytes.toBytes("d")),
         new HRegionInfo(htd.getName(), Bytes.toBytes("d"), Bytes.toBytes("z"))
         );
-    Mockito.doReturn(regions).when(rs).getOnlineRegions();
+    Mockito.doReturn(ResponseConverter.buildGetOnlineRegionResponse(
+      regions)).when(rs).getOnlineRegion((RpcController)Mockito.any(),
+        (GetOnlineRegionRequest)Mockito.any());
     
     new RSStatusTmpl().render(new StringWriter(), rs);
   }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerMetrics.java Sat May  5 04:22:52 2012
@@ -38,6 +38,7 @@ import org.apache.hadoop.hbase.client.HB
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.regionserver.metrics.RegionMetricsStorage;
 import org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics;
 import org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics.
@@ -234,7 +235,7 @@ public class TestRegionServerMetrics {
     final HRegionServer rs =
         TEST_UTIL.getMiniHBaseCluster().getRegionServer(0);
 
-    assertEquals(NUM_REGIONS + META_AND_ROOT, rs.getOnlineRegions().size());
+    assertEquals(NUM_REGIONS + META_AND_ROOT, ProtobufUtil.getOnlineRegions(rs).size());
 
     rs.doMetrics();
     for (HRegion r : TEST_UTIL.getMiniHBaseCluster().getRegions(

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java Sat May  5 04:22:52 2012
@@ -35,6 +35,7 @@ import org.apache.hadoop.hbase.client.HB
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.executor.EventHandler.EventType;
 import org.apache.hadoop.hbase.master.handler.SplitRegionHandler;
+import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
 import org.apache.hadoop.hbase.util.Threads;
@@ -122,7 +123,7 @@ public class TestSplitTransactionOnClust
       // Get region pre-split.
       HRegionServer server = cluster.getRegionServer(tableRegionIndex);
       printOutRegions(server, "Initial regions: ");
-      int regionCount = server.getOnlineRegions().size();
+      int regionCount = ProtobufUtil.getOnlineRegions(server).size();
       // Now, before we split, set special flag in master, a flag that has
       // it FAIL the processing of split.
       SplitRegionHandler.TEST_SKIP = true;
@@ -192,7 +193,7 @@ public class TestSplitTransactionOnClust
       // Get region pre-split.
       HRegionServer server = cluster.getRegionServer(tableRegionIndex);
       printOutRegions(server, "Initial regions: ");
-      int regionCount = server.getOnlineRegions().size();
+      int regionCount = ProtobufUtil.getOnlineRegions(server).size();
       // Insert into zk a blocking znode, a znode of same name as region
       // so it gets in way of our splitting.
       ZKAssign.createNodeClosing(TESTING_UTIL.getZooKeeperWatcher(),
@@ -205,7 +206,7 @@ public class TestSplitTransactionOnClust
       // Wait around a while and assert count of regions remains constant.
       for (int i = 0; i < 10; i++) {
         Thread.sleep(100);
-        assertEquals(regionCount, server.getOnlineRegions().size());
+        assertEquals(regionCount, ProtobufUtil.getOnlineRegions(server).size());
       }
       // Now clear the zknode
       ZKAssign.deleteClosingNode(TESTING_UTIL.getZooKeeperWatcher(), hri);
@@ -251,7 +252,7 @@ public class TestSplitTransactionOnClust
       // Get region pre-split.
       HRegionServer server = cluster.getRegionServer(tableRegionIndex);
       printOutRegions(server, "Initial regions: ");
-      int regionCount = server.getOnlineRegions().size();
+      int regionCount = ProtobufUtil.getOnlineRegions(server).size();
       // Now split.
       split(hri, server, regionCount);
       // Get daughters
@@ -308,14 +309,14 @@ public class TestSplitTransactionOnClust
       // Get region pre-split.
       HRegionServer server = cluster.getRegionServer(tableRegionIndex);
       printOutRegions(server, "Initial regions: ");
-      int regionCount = server.getOnlineRegions().size();
+      int regionCount = ProtobufUtil.getOnlineRegions(server).size();
       // Now split.
       split(hri, server, regionCount);
       // Get daughters
       List<HRegion> daughters = cluster.getRegions(tableName);
       assertTrue(daughters.size() >= 2);
       // Now split one of the daughters.
-      regionCount = server.getOnlineRegions().size();
+      regionCount = ProtobufUtil.getOnlineRegions(server).size();
       HRegionInfo daughter = daughters.get(0).getRegionInfo();
       // Compact first to ensure we have cleaned up references -- else the split
       // will fail.
@@ -358,7 +359,7 @@ public class TestSplitTransactionOnClust
       final int regionCount)
   throws IOException, InterruptedException {
     this.admin.split(hri.getRegionNameAsString());
-    while (server.getOnlineRegions().size() <= regionCount) {
+    while (ProtobufUtil.getOnlineRegions(server).size() <= regionCount) {
       LOG.debug("Waiting on region to split");
       Thread.sleep(100);
     }
@@ -444,7 +445,7 @@ public class TestSplitTransactionOnClust
 
   private void printOutRegions(final HRegionServer hrs, final String prefix)
       throws IOException {
-    List<HRegionInfo> regions = hrs.getOnlineRegions();
+    List<HRegionInfo> regions = ProtobufUtil.getOnlineRegions(hrs);
     for (HRegionInfo region: regions) {
       LOG.info(prefix + region.getRegionNameAsString());
     }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java?rev=1334314&r1=1334313&r2=1334314&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java Sat May  5 04:22:52 2012
@@ -916,7 +916,7 @@ public class TestHBaseFsck {
       TEST_UTIL.getHBaseAdmin().disableTable(table);
       HRegionInfo region = disabledRegions.remove(0);
       ZKAssign.createNodeOffline(zkw, region, serverName);
-      hrs.openRegion(region);
+      ProtobufUtil.openRegion(hrs, region);
 
       int iTimes = 0;
       while (true) {



Mime
View raw message