diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java index dbd4f7d..99155bd 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java @@ -92,6 +92,33 @@ public class TestClientNoCluster { } /** + * Remove the @Ignore to try out timeout and retry asettings + * @throws IOException + */ + @Test + public void testTimeoutAndRetries() throws IOException { + Configuration localConfig = HBaseConfiguration.create(this.conf); + // This override mocks up our exists/get call to throw a RegionServerStoppedException. + localConfig.set("hbase.client.connection.impl", RpcTimeoutConnection.class.getName()); + HTable table = new HTable(localConfig, HConstants.META_TABLE_NAME); + Throwable t = null; + try { + // An exists call turns into a get w/ a flag. + table.exists(new Get(Bytes.toBytes("abc"))); + } catch (SocketTimeoutException e) { + // I expect this exception. + LOG.info("Got expected exception", e); + t = e; + } catch (RetriesExhaustedException e) { + // This is the old, unwanted behavior. If we get here FAIL!!! + fail(); + } finally { + table.close(); + } + assertTrue(t != null); + } + + /** * Test that operation timeout prevails over rpc default timeout and retries, etc. * @throws IOException */ diff --git a/hbase-client/src/test/resources/hbase-site.xml b/hbase-client/src/test/resources/hbase-site.xml deleted file mode 100644 index ffeb0ef..0000000 --- a/hbase-client/src/test/resources/hbase-site.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - hbase.defaults.for.version.skip - true - - - hbase.client.retries.number - 5 - Maximum retries. Used as maximum for all retryable - operations such as fetching of the root region from root region - server, getting a cell's value, starting a row update, etc. - Default: 10. - - - diff --git a/hbase-server/src/test/resources/hbase-site.xml b/hbase-server/src/test/resources/hbase-site.xml deleted file mode 100644 index abff5f5..0000000 --- a/hbase-server/src/test/resources/hbase-site.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - hbase.regionserver.msginterval - 1000 - Interval between messages from the RegionServer to HMaster - in milliseconds. Default is 15. Set this value low if you want unit - tests to be responsive. - - - - hbase.client.pause - 1000 - General client pause value. Used mostly as value to wait - before running a retry of a failed get, region lookup, etc. - - - hbase.defaults.for.version.skip - true - - - hbase.client.retries.number - 20 - Maximum retries. Used as maximum for all retryable - operations such as fetching of the root region from root region - server, getting a cell's value, starting a row update, etc. - Default: 20. - - - - hbase.server.thread.wakefrequency - 1000 - Time to sleep in between searches for work (in milliseconds). - Used as sleep interval by service threads such as META scanner and log roller. - - - - hbase.master.event.waiting.time - 50 - Time to sleep between checks to see if a table event took place. - - - - hbase.regionserver.handler.count - 5 - Count of RPC Server instances spun up on RegionServers - Same property is used by the HMaster for count of master handlers. - Default is 10. - - - - hbase.master.info.port - -1 - The port for the hbase master web UI - Set to -1 if you do not want the info server to run. - - - - hbase.master.port - 0 - Always have masters and regionservers come up on port '0' so we don't clash over - default ports. - - - - hbase.regionserver.port - 0 - Always have masters and regionservers come up on port '0' so we don't clash over - default ports. - - - - hbase.ipc.client.fallback-to-simple-auth-allowed - true - - - - hbase.regionserver.info.port - -1 - The port for the hbase regionserver web UI - Set to -1 if you do not want the info server to run. - - - - hbase.regionserver.info.port.auto - true - Info server auto port bind. Enables automatic port - search if hbase.regionserver.info.port is already in use. - Enabled for testing to run multiple tests on one machine. - - - - hbase.master.lease.thread.wakefrequency - 3000 - The interval between checks for expired region server leases. - This value has been reduced due to the other reduced values above so that - the master will notice a dead region server sooner. The default is 15 seconds. - - - - hbase.regionserver.safemode - false - - Turn on/off safe mode in region server. Always on for production, always off - for tests. - - - - hbase.hregion.max.filesize - 67108864 - - Maximum desired file size for an HRegion. If filesize exceeds - value + (value / 2), the HRegion is split in two. Default: 256M. - - Keep the maximum filesize small so we split more often in tests. - - - - hadoop.log.dir - ${user.dir}/../logs - - - hbase.zookeeper.property.clientPort - 21818 - Property from ZooKeeper's config zoo.cfg. - The port at which the clients will connect. - - - - hbase.defaults.for.version.skip - true - - Set to true to skip the 'hbase.defaults.for.version'. - Setting this to true can be useful in contexts other than - the other side of a maven generation; i.e. running in an - ide. You'll want to set this boolean to true to avoid - seeing the RuntimException complaint: "hbase-default.xml file - seems to be for and old version of HBase (@@@VERSION@@@), this - version is X.X.X-SNAPSHOT" - - -