hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1329358 [5/5] - in /hbase/trunk: security/src/main/java/org/apache/hadoop/hbase/ipc/ src/main/java/org/apache/hadoop/hbase/catalog/ src/main/java/org/apache/hadoop/hbase/client/ src/main/java/org/apache/hadoop/hbase/ipc/ src/main/java/org/...
Date Mon, 23 Apr 2012 18:12:18 GMT
Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java?rev=1329358&r1=1329357&r2=1329358&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/MockRegionServer.java Mon Apr
23 18:12:16 2012
@@ -27,31 +27,41 @@ import java.util.TreeMap;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.hbase.HRegionInfo;
-import org.apache.hadoop.hbase.HServerInfo;
-import org.apache.hadoop.hbase.NotServingRegionException;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.catalog.CatalogTracker;
-import org.apache.hadoop.hbase.client.Append;
-import org.apache.hadoop.hbase.client.Delete;
+import org.apache.hadoop.hbase.client.AdminProtocol;
+import org.apache.hadoop.hbase.client.ClientProtocol;
 import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.Increment;
-import org.apache.hadoop.hbase.client.MultiAction;
-import org.apache.hadoop.hbase.client.MultiResponse;
-import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.client.RowMutations;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.client.coprocessor.Exec;
-import org.apache.hadoop.hbase.client.coprocessor.ExecResult;
-import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
-import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
-import org.apache.hadoop.hbase.io.hfile.BlockCacheColumnFamilySummary;
-import org.apache.hadoop.hbase.ipc.HRegionInterface;
 import org.apache.hadoop.hbase.ipc.ProtocolSignature;
 import org.apache.hadoop.hbase.ipc.RpcServer;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.protobuf.ClientProtocol;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CloseRegionRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CloseRegionResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CompactRegionRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CompactRegionResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.FlushRegionRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.FlushRegionResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetOnlineRegionRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetOnlineRegionResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetServerInfoRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetServerInfoResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetStoreFileRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetStoreFileResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ReplicateWALEntryRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ReplicateWALEntryResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.RollWALWriterRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.RollWALWriterResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.SplitRegionRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.SplitRegionResponse;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.StopServerRequest;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.StopServerResponse;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileResponse;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ExecCoprocessorRequest;
@@ -70,14 +80,10 @@ import org.apache.hadoop.hbase.protobuf.
 import org.apache.hadoop.hbase.regionserver.CompactionRequestor;
 import org.apache.hadoop.hbase.regionserver.FlushRequester;
 import org.apache.hadoop.hbase.regionserver.HRegion;
-import org.apache.hadoop.hbase.regionserver.RegionOpeningState;
 import org.apache.hadoop.hbase.regionserver.RegionServerAccounting;
 import org.apache.hadoop.hbase.regionserver.RegionServerServices;
-import org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException;
 import org.apache.hadoop.hbase.regionserver.wal.HLog;
-import org.apache.hadoop.hbase.regionserver.wal.HLog.Entry;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.apache.zookeeper.KeeperException;
 
@@ -92,7 +98,7 @@ import com.google.protobuf.ServiceExcept
  * {@link #setGetResult(byte[], byte[], Result)} for how to fill the backing data
  * store that the get pulls from.
  */
-class MockRegionServer implements HRegionInterface, ClientProtocol, RegionServerServices
{
+class MockRegionServer implements AdminProtocol, ClientProtocol, RegionServerServices {
   private final ServerName sn;
   private final ZooKeeperWatcher zkw;
   private final Configuration conf;
@@ -209,138 +215,12 @@ class MockRegionServer implements HRegio
     return false;
   }
 
-  @Override
-  public HRegionInfo getRegionInfo(byte[] regionName) {
-    // Just return this.  Calls to getRegionInfo are usually to test connection
-    // to regionserver does reasonable things so should be safe to return
-    // anything.
-    return HRegionInfo.ROOT_REGIONINFO;
-  }
-
-  @Override
-  public void flushRegion(byte[] regionName) throws IllegalArgumentException,
-      IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public void flushRegion(byte[] regionName, long ifOlderThanTS)
-      throws IllegalArgumentException, IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public long getLastFlushTime(byte[] regionName) {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public List<String> getStoreFileList(byte[] regionName, byte[] columnFamily)
-      throws IllegalArgumentException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public List<String> getStoreFileList(byte[] regionName,
-      byte[][] columnFamilies) throws IllegalArgumentException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public List<String> getStoreFileList(byte[] regionName)
-      throws IllegalArgumentException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Result getClosestRowBefore(byte[] regionName, byte[] row,
-      byte[] family) throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Result get(byte[] regionName, Get get) throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public boolean exists(byte[] regionName, Get get) throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public void put(byte[] regionName, Put put) throws IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public int put(byte[] regionName, List<Put> puts) throws IOException {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public void delete(byte[] regionName, Delete delete) throws IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public int delete(byte[] regionName, List<Delete> deletes)
-      throws IOException {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public boolean checkAndPut(byte[] regionName, byte[] row, byte[] family,
-      byte[] qualifier, byte[] value, Put put) throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean checkAndDelete(byte[] regionName, byte[] row, byte[] family,
-      byte[] qualifier, byte[] value, Delete delete) throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public long incrementColumnValue(byte[] regionName, byte[] row,
-      byte[] family, byte[] qualifier, long amount, boolean writeToWAL)
-      throws IOException {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public Result append(byte[] regionName, Append append) throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Result increment(byte[] regionName, Increment increment)
-      throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
   public long openScanner(byte[] regionName, Scan scan) throws IOException {
     long scannerId = this.random.nextLong();
     this.scannersAndOffsets.put(scannerId, new RegionNameAndIndex(regionName));
     return scannerId;
   }
 
-  @Override
   public Result next(long scannerId) throws IOException {
     RegionNameAndIndex rnai = this.scannersAndOffsets.get(scannerId);
     int index = rnai.getThenIncrement();
@@ -349,174 +229,17 @@ class MockRegionServer implements HRegio
     return index < results.length? results[index]: null;
   }
 
-  @Override
   public Result [] next(long scannerId, int numberOfRows) throws IOException {
     // Just return one result whatever they ask for.
     Result r = next(scannerId);
     return r == null? null: new Result [] {r};
   }
 
-  @Override
   public void close(final long scannerId) throws IOException {
     this.scannersAndOffsets.remove(scannerId);
   }
 
   @Override
-  public long lockRow(byte[] regionName, byte[] row) throws IOException {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public void unlockRow(byte[] regionName, long lockId) throws IOException {
-    // TODO Auto-generated method stub
-    
-  }
-
-  @Override
-  public List<HRegionInfo> getOnlineRegions() throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public List<HRegion> getOnlineRegions(byte[] tableName) throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public HServerInfo getHServerInfo() throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public <R> MultiResponse multi(MultiAction<R> multi) throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public boolean bulkLoadHFiles(List<Pair<byte[], String>> familyPaths,
-      byte[] regionName) throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public RegionOpeningState openRegion(HRegionInfo region) throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public RegionOpeningState openRegion(HRegionInfo region,
-      int versionOfOfflineNode) throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public void openRegions(List<HRegionInfo> regions) throws IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public boolean closeRegion(HRegionInfo region) throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean closeRegion(HRegionInfo region, int versionOfClosingNode)
-      throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean closeRegion(HRegionInfo region, boolean zk)
-      throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean closeRegion(byte[] encodedRegionName, boolean zk)
-      throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public void flushRegion(HRegionInfo regionInfo)
-      throws NotServingRegionException, IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public void splitRegion(HRegionInfo regionInfo)
-      throws NotServingRegionException, IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public void splitRegion(HRegionInfo regionInfo, byte[] splitPoint)
-      throws NotServingRegionException, IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public void compactRegion(HRegionInfo regionInfo, boolean major)
-      throws NotServingRegionException, IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public void replicateLogEntries(Entry[] entries) throws IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
-  public ExecResult execCoprocessor(byte[] regionName, Exec call)
-      throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public boolean checkAndPut(byte[] regionName, byte[] row, byte[] family,
-      byte[] qualifier, CompareOp compareOp,
-      WritableByteArrayComparable comparator, Put put) throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean checkAndDelete(byte[] regionName, byte[] row, byte[] family,
-      byte[] qualifier, CompareOp compareOp,
-      WritableByteArrayComparable comparator, Delete delete)
-      throws IOException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public List<BlockCacheColumnFamilySummary> getBlockCacheColumnFamilySummaries()
-      throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public byte[][] rollHLogWriter() throws IOException,
-      FailedLogCloseException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
   public void stop(String why) {
     this.zkw.close();
   }
@@ -613,11 +336,6 @@ class MockRegionServer implements HRegio
   }
 
   @Override
-  public void mutateRow(byte[] regionName, RowMutations rm) throws IOException {
-    // TODO Auto-generated method stub
-  }
-
-  @Override
   public GetResponse get(RpcController controller, GetRequest request)
       throws ServiceException {
     byte[] regionName = request.getRegion().getValue().toByteArray();
@@ -699,4 +417,95 @@ class MockRegionServer implements HRegio
     // TODO Auto-generated method stub
     return null;
   }
+
+  @Override
+  public GetRegionInfoResponse getRegionInfo(RpcController controller,
+      GetRegionInfoRequest request) throws ServiceException {
+    GetRegionInfoResponse.Builder builder = GetRegionInfoResponse.newBuilder();
+    builder.setRegionInfo(ProtobufUtil.toRegionInfo(HRegionInfo.ROOT_REGIONINFO));
+    return builder.build();
+  }
+
+  @Override
+  public GetStoreFileResponse getStoreFile(RpcController controller,
+      GetStoreFileRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public GetOnlineRegionResponse getOnlineRegion(RpcController controller,
+      GetOnlineRegionRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public OpenRegionResponse openRegion(RpcController controller,
+      OpenRegionRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public CloseRegionResponse closeRegion(RpcController controller,
+      CloseRegionRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public FlushRegionResponse flushRegion(RpcController controller,
+      FlushRegionRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public SplitRegionResponse splitRegion(RpcController controller,
+      SplitRegionRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public CompactRegionResponse compactRegion(RpcController controller,
+      CompactRegionRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public ReplicateWALEntryResponse replicateWALEntry(RpcController controller,
+      ReplicateWALEntryRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public RollWALWriterResponse rollWALWriter(RpcController controller,
+      RollWALWriterRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public GetServerInfoResponse getServerInfo(RpcController controller,
+      GetServerInfoRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public StopServerResponse stopServer(RpcController controller,
+      StopServerRequest request) throws ServiceException {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public List<HRegion> getOnlineRegions(byte[] tableName) throws IOException {
+    // TODO Auto-generated method stub
+    return null;
+  }
 }
\ No newline at end of file

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java?rev=1329358&r1=1329357&r2=1329358&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManager.java Mon
Apr 23 18:12:16 2012
@@ -39,6 +39,7 @@ import org.apache.hadoop.hbase.ServerNam
 import org.apache.hadoop.hbase.SmallTests;
 import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.catalog.CatalogTracker;
+import org.apache.hadoop.hbase.client.ClientProtocol;
 import org.apache.hadoop.hbase.client.HConnection;
 import org.apache.hadoop.hbase.client.HConnectionTestingUtility;
 import org.apache.hadoop.hbase.client.Result;
@@ -48,7 +49,6 @@ import org.apache.hadoop.hbase.executor.
 import org.apache.hadoop.hbase.executor.ExecutorService.ExecutorType;
 import org.apache.hadoop.hbase.master.handler.ServerShutdownHandler;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.protobuf.ClientProtocol;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.GetRequest;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.GetResponse;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanRequest;

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java?rev=1329358&r1=1329357&r2=1329358&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitor.java Mon Apr
23 18:12:16 2012
@@ -47,15 +47,15 @@ import org.apache.hadoop.hbase.ServerNam
 import org.apache.hadoop.hbase.SmallTests;
 import org.apache.hadoop.hbase.TableDescriptors;
 import org.apache.hadoop.hbase.catalog.CatalogTracker;
+import org.apache.hadoop.hbase.client.AdminProtocol;
+import org.apache.hadoop.hbase.client.ClientProtocol;
 import org.apache.hadoop.hbase.client.HConnection;
 import org.apache.hadoop.hbase.client.HConnectionManager;
 import org.apache.hadoop.hbase.client.HConnectionTestingUtility;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.executor.ExecutorService;
 import org.apache.hadoop.hbase.io.Reference;
-import org.apache.hadoop.hbase.ipc.HRegionInterface;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
-import org.apache.hadoop.hbase.protobuf.ClientProtocol;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutateRequest;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutateResponse;
 import org.apache.hadoop.hbase.regionserver.Store;
@@ -93,12 +93,12 @@ public class TestCatalogJanitor {
       } catch (ServiceException se) {
         throw ProtobufUtil.getRemoteException(se);
       }
-      // Mock an HConnection and a HRegionInterface implementation.  Have the
+      // Mock an HConnection and a AdminProtocol implementation.  Have the
       // HConnection return the HRI.  Have the HRI return a few mocked up responses
       // to make our test work.
       this.connection =
         HConnectionTestingUtility.getMockedConnectionAndDecorate(this.c,
-          Mockito.mock(HRegionInterface.class), ri,
+          Mockito.mock(AdminProtocol.class), ri,
           new ServerName("example.org,12345,6789"),
           HRegionInfo.FIRST_META_REGIONINFO);
       // Set hbase.rootdir into test dir.
@@ -106,7 +106,7 @@ public class TestCatalogJanitor {
       Path rootdir = fs.makeQualified(new Path(this.c.get(HConstants.HBASE_DIR)));
       this.c.set(HConstants.HBASE_DIR, rootdir.toString());
       this.ct = Mockito.mock(CatalogTracker.class);
-      HRegionInterface hri = Mockito.mock(HRegionInterface.class);
+      AdminProtocol hri = Mockito.mock(AdminProtocol.class);
       Mockito.when(this.ct.getConnection()).thenReturn(this.connection);
       Mockito.when(ct.waitForMetaServerConnectionDefault()).thenReturn(hri);
     }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java?rev=1329358&r1=1329357&r2=1329358&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java Mon Apr 23 18:12:16
2012
@@ -23,7 +23,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.*;
 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.executor.EventHandler;
 import org.apache.hadoop.hbase.executor.EventHandler.EventHandlerListener;
@@ -31,7 +30,6 @@ import org.apache.hadoop.hbase.executor.
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
 
-import java.io.IOException;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java?rev=1329358&r1=1329357&r2=1329358&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java Mon Apr
23 18:12:16 2012
@@ -68,7 +68,6 @@ import org.apache.hadoop.hbase.filter.Fi
 import org.apache.hadoop.hbase.filter.NullComparator;
 import org.apache.hadoop.hbase.filter.PrefixFilter;
 import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
-import org.apache.hadoop.hbase.io.hfile.Compression;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.monitoring.MonitoredTask;
 import org.apache.hadoop.hbase.monitoring.TaskMonitor;

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java?rev=1329358&r1=1329357&r2=1329358&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
(original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
Mon Apr 23 18:12:16 2012
@@ -30,6 +30,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.*;
 import org.apache.hadoop.hbase.MultithreadedTestUtil.RepeatingTestThread;
 import org.apache.hadoop.hbase.MultithreadedTestUtil.TestContext;
+import org.apache.hadoop.hbase.client.AdminProtocol;
 import org.apache.hadoop.hbase.client.HConnection;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Result;
@@ -39,8 +40,8 @@ import org.apache.hadoop.hbase.client.Se
 import org.apache.hadoop.hbase.io.hfile.CacheConfig;
 import org.apache.hadoop.hbase.io.hfile.Compression;
 import org.apache.hadoop.hbase.io.hfile.HFile;
-import org.apache.hadoop.hbase.ipc.HRegionInterface;
 import org.apache.hadoop.hbase.protobuf.RequestConverter;
+import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CompactRegionRequest;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.BulkLoadHFileRequest;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
@@ -164,9 +165,12 @@ public class TestHRegionServerBulkLoad {
           public Void call() throws Exception {
             LOG.debug("compacting " + location + " for row "
                 + Bytes.toStringBinary(row));
-            HRegionInterface server = connection.getHRegionConnection(
+            AdminProtocol server = connection.getAdmin(
               location.getHostname(), location.getPort());
-            server.compactRegion(location.getRegionInfo(), true);
+            CompactRegionRequest request =
+              RequestConverter.buildCompactRegionRequest(
+                location.getRegionInfo().getRegionName(), true);
+            server.compactRegion(null, request);
             numCompactions.incrementAndGet();
             return null;
           }

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=1329358&r1=1329357&r2=1329358&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 Mon Apr 23 18:12:16
2012
@@ -49,6 +49,7 @@ import org.apache.hadoop.hbase.HTableDes
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.client.AdminProtocol;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.client.HConnection;
@@ -59,7 +60,7 @@ import org.apache.hadoop.hbase.client.Re
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.executor.EventHandler.EventType;
 import org.apache.hadoop.hbase.executor.RegionTransitionData;
-import org.apache.hadoop.hbase.ipc.HRegionInterface;
+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.HBaseFsck.ErrorReporter.ERROR_CODE;
@@ -400,19 +401,19 @@ public class TestHBaseFsck {
   /**
    * Get region info from local cluster.
    */
-  Map<ServerName, List<String>> getDeployedHRIs(HBaseAdmin admin)
-    throws IOException {
+  Map<ServerName, List<String>> getDeployedHRIs(
+      final HBaseAdmin admin) throws IOException {
     ClusterStatus status = admin.getMaster().getClusterStatus();
     Collection<ServerName> regionServers = status.getServers();
     Map<ServerName, List<String>> mm =
         new HashMap<ServerName, List<String>>();
     HConnection connection = admin.getConnection();
     for (ServerName hsi : regionServers) {
-      HRegionInterface server =
-        connection.getHRegionConnection(hsi.getHostname(), hsi.getPort());
+      AdminProtocol server =
+        connection.getAdmin(hsi.getHostname(), hsi.getPort());
 
       // list all online regions from this region server
-      List<HRegionInfo> regions = server.getOnlineRegions();
+      List<HRegionInfo> regions = ProtobufUtil.getOnlineRegions(server);
       List<String> regionNames = new ArrayList<String>();
       for (HRegionInfo hri : regions) {
         regionNames.add(hri.getRegionNameAsString());



Mime
View raw message