hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject hbase git commit: HBASE-15658 Avoid excess meta cache clearing for RegionServerCallable
Date Wed, 27 Apr 2016 05:54:25 GMT
Repository: hbase
Updated Branches:
  refs/heads/master e512c40ad -> ce318a290


HBASE-15658 Avoid excess meta cache clearing for RegionServerCallable


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ce318a29
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ce318a29
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ce318a29

Branch: refs/heads/master
Commit: ce318a2906817058ae7b2fce6e9b54d9d6230f9b
Parents: e512c40
Author: Gary Helmling <garyh@apache.org>
Authored: Mon Apr 18 02:03:18 2016 -0700
Committer: Gary Helmling <garyh@apache.org>
Committed: Tue Apr 26 22:54:13 2016 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/client/MetaCache.java   |   2 +-
 .../hadoop/hbase/client/MetricsConnection.java  |   4 +-
 .../hbase/client/RegionServerCallable.java      |  11 +-
 .../hbase/client/RpcRetryingCallerImpl.java     |   3 +-
 .../hbase/regionserver/RSRpcServices.java       |   3 +-
 .../hadoop/hbase/client/TestMetaCache.java      | 293 +++++++++++++------
 6 files changed, 219 insertions(+), 97 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ce318a29/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java
index 800bba6..3914df5 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java
@@ -54,7 +54,7 @@ public class MetaCache {
 
   // The presence of a server in the map implies it's likely that there is an
   // entry in cachedRegionLocations that map to this server; but the absence
-  // of a server in this map guarentees that there is no entry in cache that
+  // of a server in this map guarantees that there is no entry in cache that
   // maps to the absent server.
   // The access to this attribute must be protected by a lock on cachedRegionLocations
   private final Set<ServerName> cachedServers = new CopyOnWriteArraySet<>();

http://git-wip-us.apache.org/repos/asf/hbase/blob/ce318a29/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetricsConnection.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetricsConnection.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetricsConnection.java
index 53a3326..2839fb0 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetricsConnection.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetricsConnection.java
@@ -283,8 +283,8 @@ public class MetricsConnection implements StatisticTrackable {
   @VisibleForTesting protected final CallTracker putTracker;
   @VisibleForTesting protected final CallTracker multiTracker;
   @VisibleForTesting protected final RunnerStats runnerStats;
-  private final Counter metaCacheNumClearServer;
-  private final Counter metaCacheNumClearRegion;
+  @VisibleForTesting protected final Counter metaCacheNumClearServer;
+  @VisibleForTesting protected final Counter metaCacheNumClearRegion;
 
   // dynamic metrics
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/ce318a29/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java
index 6bd8f75..6e0752b 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionServerCallable.java
@@ -26,6 +26,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HRegionLocation;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.TableNotEnabledException;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ClientService;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -66,13 +67,19 @@ public abstract class RegionServerCallable<T> implements RetryingCallable<T>
{
   /**
    * Prepare for connection to the server hosting region with row from tablename.  Does lookup
    * to find region location and hosting server.
-   * @param reload Set this to true if connection should re-find the region
+   * @param reload Set to true to re-check the table state
    * @throws IOException e
    */
   @Override
   public void prepare(final boolean reload) throws IOException {
+    // check table state if this is a retry
+    if (reload &&
+        !tableName.equals(TableName.META_TABLE_NAME) &&
+        getConnection().isTableDisabled(tableName)) {
+      throw new TableNotEnabledException(tableName.getNameAsString() + " is disabled.");
+    }
     try (RegionLocator regionLocator = connection.getRegionLocator(tableName)) {
-      this.location = regionLocator.getRegionLocation(row, reload);
+      this.location = regionLocator.getRegionLocation(row);
     }
     if (this.location == null) {
       throw new IOException("Failed to find location, tableName=" + tableName +

http://git-wip-us.apache.org/repos/asf/hbase/blob/ce318a29/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java
index ccd0d2c..41405ec 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RpcRetryingCallerImpl.java
@@ -96,7 +96,8 @@ public class RpcRetryingCallerImpl<T> implements RpcRetryingCaller<T>
{
     for (int tries = 0;; tries++) {
       long expectedSleep;
       try {
-        callable.prepare(tries != 0); // if called with false, check table status on ZK
+        // bad cache entries are cleared in the call to RetryingCallable#throwable() in catch
block
+        callable.prepare(tries != 0);
         interceptor.intercept(context.prepare(callable, tries));
         return callable.call(getTimeout(callTimeout));
       } catch (PreemptiveFastFailException e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/ce318a29/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index 2d27219..d15b89b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -1180,7 +1180,8 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
    * @throws IOException if the specifier is not null,
    *    but failed to find the region
    */
-  Region getRegion(
+  @VisibleForTesting
+  public Region getRegion(
       final RegionSpecifier regionSpecifier) throws IOException {
     ByteString value = regionSpecifier.getValue();
     RegionSpecifierType type = regionSpecifier.getType();

http://git-wip-us.apache.org/repos/asf/hbase/blob/ce318a29/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java
index 23b9eed..a2ce0d2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMetaCache.java
@@ -26,16 +26,15 @@ import org.apache.hadoop.hbase.exceptions.ClientExceptionsUtil;
 import org.apache.hadoop.hbase.exceptions.RegionOpeningException;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.GetResponse;
+import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
 import org.apache.hadoop.hbase.quotas.ThrottlingException;
 import org.apache.hadoop.hbase.regionserver.HRegionServer;
 import org.apache.hadoop.hbase.regionserver.RSRpcServices;
+import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.testclassification.ClientTests;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.JVMClusterUtil;
-import org.junit.After;
 import org.junit.AfterClass;
-import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -48,6 +47,7 @@ import static junit.framework.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 @Category({MediumTests.class, ClientTests.class})
 public class TestMetaCache {
@@ -55,8 +55,8 @@ public class TestMetaCache {
   private static final TableName TABLE_NAME = TableName.valueOf("test_table");
   private static final byte[] FAMILY = Bytes.toBytes("fam1");
   private static final byte[] QUALIFIER = Bytes.toBytes("qual");
-  private ConnectionImplementation conn;
-  private HRegionServer badRS;
+
+  private static HRegionServer badRS;
 
   /**
    * @throws java.lang.Exception
@@ -64,10 +64,18 @@ public class TestMetaCache {
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     Configuration conf = TEST_UTIL.getConfiguration();
-    conf.set("hbase.client.retries.number", "1");
+    conf.setStrings(HConstants.REGION_SERVER_IMPL,
+        RegionServerWithFakeRpcServices.class.getName());
     TEST_UTIL.startMiniCluster(1);
     TEST_UTIL.getHBaseCluster().waitForActiveAndReadyMaster();
     TEST_UTIL.waitUntilAllRegionsAssigned(TABLE_NAME.META_TABLE_NAME);
+    badRS = TEST_UTIL.getHBaseCluster().getRegionServer(0);
+    assertTrue(badRS.getRSRpcServices() instanceof FakeRSRpcServices);
+    HTableDescriptor table = new HTableDescriptor(TABLE_NAME);
+    HColumnDescriptor fam = new HColumnDescriptor(FAMILY);
+    fam.setMaxVersions(2);
+    table.addFamily(fam);
+    TEST_UTIL.createTable(table, null);
   }
 
 
@@ -79,88 +87,101 @@ public class TestMetaCache {
     TEST_UTIL.shutdownMiniCluster();
   }
 
-  /**
-   * @throws java.lang.Exception
-   */
-  @Before
-  public void setup() throws Exception {
-    MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
-
-    cluster.getConfiguration().setStrings(HConstants.REGION_SERVER_IMPL,
-      RegionServerWithFakeRpcServices.class.getName());
-    JVMClusterUtil.RegionServerThread rsThread = cluster.startRegionServer();
-    rsThread.waitForServerOnline();
-    badRS = rsThread.getRegionServer();
-    assertTrue(badRS.getRSRpcServices() instanceof FakeRSRpcServices);
-    cluster.getConfiguration().setStrings(HConstants.REGION_SERVER_IMPL,
-      HRegionServer.class.getName());
+  @Test
+  public void testPreserveMetaCacheOnException() throws Exception {
+    ((FakeRSRpcServices)badRS.getRSRpcServices()).setExceptionInjector(
+        new RoundRobinExceptionInjector());
+    Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
+    conf.set("hbase.client.retries.number", "1");
+    ConnectionImplementation conn =
+        (ConnectionImplementation) ConnectionFactory.createConnection(conf);
+    try {
+      Table table = conn.getTable(TABLE_NAME);
+      byte[] row = Bytes.toBytes("row1");
 
-    assertEquals(2, cluster.getRegionServerThreads().size());
+      Put put = new Put(row);
+      put.addColumn(FAMILY, QUALIFIER, Bytes.toBytes(10));
+      Get get = new Get(row);
+      Append append = new Append(row);
+      append.add(FAMILY, QUALIFIER, Bytes.toBytes(11));
+      Increment increment = new Increment(row);
+      increment.addColumn(FAMILY, QUALIFIER, 10);
+      Delete delete = new Delete(row);
+      delete.addColumn(FAMILY, QUALIFIER);
+      RowMutations mutations = new RowMutations(row);
+      mutations.add(put);
+      mutations.add(delete);
 
-    conn = (ConnectionImplementation) ConnectionFactory.createConnection(
-      TEST_UTIL.getConfiguration());
-    HTableDescriptor table = new HTableDescriptor(TABLE_NAME);
-    HColumnDescriptor fam = new HColumnDescriptor(FAMILY);
-    fam.setMaxVersions(2);
-    table.addFamily(fam);
-    try (Admin admin = conn.getAdmin()) {
-      admin.createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
+      Exception exp;
+      boolean success;
+      for (int i = 0; i < 50; i++) {
+        exp = null;
+        success = false;
+        try {
+          table.put(put);
+          // If at least one operation succeeded, we should have cached the region location.
+          success = true;
+          table.get(get);
+          table.append(append);
+          table.increment(increment);
+          table.delete(delete);
+          table.mutateRow(mutations);
+        } catch (IOException ex) {
+          // Only keep track of the last exception that updated the meta cache
+          if (ClientExceptionsUtil.isMetaClearingException(ex) || success) {
+            exp = ex;
+          }
+        }
+        // Do not test if we did not touch the meta cache in this iteration.
+        if (exp != null && ClientExceptionsUtil.isMetaClearingException(exp)) {
+          assertNull(conn.getCachedLocation(TABLE_NAME, row));
+        } else if (success) {
+          assertNotNull(conn.getCachedLocation(TABLE_NAME, row));
+        }
+      }
+    } finally {
+      conn.close();
     }
-    TEST_UTIL.waitUntilAllRegionsAssigned(TABLE_NAME);
-  }
-
-  /**
-   * @throws java.lang.Exception
-   */
-  @After
-  public void tearDown() throws Exception {
-    // Nothing to do.
   }
 
   @Test
-  public void testPreserveMetaCacheOnException() throws Exception {
-    Table table = conn.getTable(TABLE_NAME);
-    byte[] row = badRS.getOnlineRegions().get(0).getRegionInfo().getStartKey();
-
-    Put put = new Put(row);
-    put.addColumn(FAMILY, QUALIFIER, Bytes.toBytes(10));
-    Get get = new Get(row);
-    Append append = new Append(row);
-    append.add(FAMILY, QUALIFIER, Bytes.toBytes(11));
-    Increment increment = new Increment(row);
-    increment.addColumn(FAMILY, QUALIFIER, 10);
-    Delete delete = new Delete(row);
-    delete.addColumn(FAMILY, QUALIFIER);
-    RowMutations mutations = new RowMutations(row);
-    mutations.add(put);
-    mutations.add(delete);
-
-    Exception exp;
-    boolean success;
-    for (int i = 0; i < 50; i++) {
-      exp = null;
-      success =false;
+  public void testCacheClearingOnCallQueueTooBig() throws Exception {
+    ((FakeRSRpcServices)badRS.getRSRpcServices()).setExceptionInjector(
+        new CallQueueTooBigExceptionInjector());
+    Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
+    conf.set("hbase.client.retries.number", "2");
+    conf.set(MetricsConnection.CLIENT_SIDE_METRICS_ENABLED_KEY, "true");
+    ConnectionImplementation conn =
+        (ConnectionImplementation) ConnectionFactory.createConnection(conf);
+    try {
+      Table table = conn.getTable(TABLE_NAME);
+      byte[] row = Bytes.toBytes("row1");
+
+      Put put = new Put(row);
+      put.addColumn(FAMILY, QUALIFIER, Bytes.toBytes(10));
+      table.put(put);
+
+      // obtain the client metrics
+      MetricsConnection metrics = conn.getConnectionMetrics();
+      long preGetRegionClears = metrics.metaCacheNumClearRegion.getCount();
+      long preGetServerClears = metrics.metaCacheNumClearServer.getCount();
+
+      // attempt a get on the test table
+      Get get = new Get(row);
       try {
-        table.put(put);
-        // If at least one operation succeeded, we should have cached the region location.
-        success = true;
         table.get(get);
-        table.append(append);
-        table.increment(increment);
-        table.delete(delete);
-        table.mutateRow(mutations);
-      } catch (IOException ex) {
-        // Only keep track of the last exception that updated the meta cache
-        if (ClientExceptionsUtil.isMetaClearingException(ex) || success) {
-          exp = ex;
-        }
-      }
-      // Do not test if we did not touch the meta cache in this iteration.
-      if(exp != null && ClientExceptionsUtil.isMetaClearingException(exp)) {
-        assertNull(conn.getCachedLocation(TABLE_NAME, row));
-      } else if (success) {
-        assertNotNull(conn.getCachedLocation(TABLE_NAME, row));
+        fail("Expected CallQueueTooBigException");
+      } catch (RetriesExhaustedException ree) {
+        // expected
       }
+
+      // verify that no cache clearing took place
+      long postGetRegionClears = metrics.metaCacheNumClearRegion.getCount();
+      long postGetServerClears = metrics.metaCacheNumClearServer.getCount();
+      assertEquals(preGetRegionClears, postGetRegionClears);
+      assertEquals(preGetServerClears, postGetServerClears);
+    } finally {
+      conn.close();
     }
   }
 
@@ -175,7 +196,8 @@ public class TestMetaCache {
     }};
   }
 
-  protected static class RegionServerWithFakeRpcServices extends HRegionServer {
+  public static class RegionServerWithFakeRpcServices extends HRegionServer {
+    private FakeRSRpcServices rsRpcServices;
 
     public RegionServerWithFakeRpcServices(Configuration conf, CoordinatedStateManager cp)
       throws IOException, InterruptedException {
@@ -184,47 +206,115 @@ public class TestMetaCache {
 
     @Override
     protected RSRpcServices createRpcServices() throws IOException {
-      return new FakeRSRpcServices(this);
+      this.rsRpcServices = new FakeRSRpcServices(this);
+      return rsRpcServices;
+    }
+
+    public void setExceptionInjector(ExceptionInjector injector) {
+      rsRpcServices.setExceptionInjector(injector);
     }
   }
 
-  protected static class FakeRSRpcServices extends RSRpcServices {
+  public static class FakeRSRpcServices extends RSRpcServices {
 
-    private int numReqs = -1;
-    private int expCount = -1;
-    private List<Throwable> metaCachePreservingExceptions = metaCachePreservingExceptions();
+    private ExceptionInjector exceptions;
 
     public FakeRSRpcServices(HRegionServer rs) throws IOException {
       super(rs);
+      exceptions = new RoundRobinExceptionInjector();
+    }
+
+    public void setExceptionInjector(ExceptionInjector injector) {
+      this.exceptions = injector;
     }
 
     @Override
     public GetResponse get(final RpcController controller,
                            final ClientProtos.GetRequest request) throws ServiceException
{
-      throwSomeExceptions();
+      exceptions.throwOnGet(this, request);
       return super.get(controller, request);
     }
 
     @Override
     public ClientProtos.MutateResponse mutate(final RpcController controller,
         final ClientProtos.MutateRequest request) throws ServiceException {
-      throwSomeExceptions();
+      exceptions.throwOnMutate(this, request);
       return super.mutate(controller, request);
     }
 
     @Override
     public ClientProtos.ScanResponse scan(final RpcController controller,
         final ClientProtos.ScanRequest request) throws ServiceException {
-      throwSomeExceptions();
+      exceptions.throwOnScan(this, request);
       return super.scan(controller, request);
     }
 
+    public Region getRegion(
+        final HBaseProtos.RegionSpecifier regionSpecifier) throws IOException {
+      return super.getRegion(regionSpecifier);
+    }
+  }
+
+  public static abstract class ExceptionInjector {
+    protected boolean isTestTable(FakeRSRpcServices rpcServices,
+                                  HBaseProtos.RegionSpecifier regionSpec) throws ServiceException
{
+      try {
+        return TABLE_NAME.equals(
+            rpcServices.getRegion(regionSpec).getTableDesc().getTableName());
+      } catch (IOException ioe) {
+        throw new ServiceException(ioe);
+      }
+    }
+
+    public abstract void throwOnGet(FakeRSRpcServices rpcServices, ClientProtos.GetRequest
request)
+        throws ServiceException;
+
+    public abstract void throwOnMutate(FakeRSRpcServices rpcServices, ClientProtos.MutateRequest
request)
+        throws ServiceException;
+
+    public abstract void throwOnScan(FakeRSRpcServices rpcServices, ClientProtos.ScanRequest
request)
+        throws ServiceException;
+  }
+
+  /**
+   * Rotates through the possible cache clearing and non-cache clearing exceptions
+   * for requests.
+   */
+  public static class RoundRobinExceptionInjector extends ExceptionInjector {
+    private int numReqs = -1;
+    private int expCount = -1;
+    private List<Throwable> metaCachePreservingExceptions = metaCachePreservingExceptions();
+
+    public void throwOnGet(FakeRSRpcServices rpcServices, ClientProtos.GetRequest request)
+        throws ServiceException {
+      throwSomeExceptions(rpcServices, request.getRegion());
+    }
+
+    public void throwOnMutate(FakeRSRpcServices rpcServices, ClientProtos.MutateRequest request)
+        throws ServiceException {
+      throwSomeExceptions(rpcServices, request.getRegion());
+    }
+
+    public void throwOnScan(FakeRSRpcServices rpcServices, ClientProtos.ScanRequest request)
+        throws ServiceException {
+      if (!request.hasScannerId()) {
+        // only handle initial scan requests
+        throwSomeExceptions(rpcServices, request.getRegion());
+      }
+    }
+
     /**
      * Throw some exceptions. Mostly throw exceptions which do not clear meta cache.
      * Periodically throw NotSevingRegionException which clears the meta cache.
      * @throws ServiceException
      */
-    private void throwSomeExceptions() throws ServiceException {
+    private void throwSomeExceptions(FakeRSRpcServices rpcServices,
+                                     HBaseProtos.RegionSpecifier regionSpec)
+        throws ServiceException {
+      if (!isTestTable(rpcServices, regionSpec)) {
+        return;
+      }
+
       numReqs++;
       // Succeed every 5 request, throw cache clearing exceptions twice every 5 requests
and throw
       // meta cache preserving exceptions otherwise.
@@ -239,8 +329,31 @@ public class TestMetaCache {
       // single Gets.
       expCount++;
       Throwable t = metaCachePreservingExceptions.get(
-        expCount % metaCachePreservingExceptions.size());
+          expCount % metaCachePreservingExceptions.size());
       throw new ServiceException(t);
     }
   }
+
+  /**
+   * Throws CallQueueTooBigException for all gets.
+   */
+  public static class CallQueueTooBigExceptionInjector extends ExceptionInjector {
+    @Override
+    public void throwOnGet(FakeRSRpcServices rpcServices, ClientProtos.GetRequest request)
+        throws ServiceException {
+      if (isTestTable(rpcServices, request.getRegion())) {
+        throw new ServiceException(new CallQueueTooBigException());
+      }
+    }
+
+    @Override
+    public void throwOnMutate(FakeRSRpcServices rpcServices, ClientProtos.MutateRequest request)
+        throws ServiceException {
+    }
+
+    @Override
+    public void throwOnScan(FakeRSRpcServices rpcServices, ClientProtos.ScanRequest request)
+        throws ServiceException {
+    }
+  }
 }
\ No newline at end of file


Mime
View raw message