From 3cc80e37c6c4e3c94b531340f96716c29d02bd12 Mon Sep 17 00:00:00 2001 From: stack Date: Mon, 1 Feb 2016 08:08:07 -0800 Subject: [PATCH] HBASE-14969 Add throughput controller for flush; ADDENDUM --- .../throttle/TestFlushWithThroughputController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java index 5d5be8798d4..8908c71df81 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/throttle/TestFlushWithThroughputController.java @@ -168,9 +168,6 @@ public class TestFlushWithThroughputController { conf.setInt(PressureAwareFlushThroughputController.HBASE_HSTORE_FLUSH_THROUGHPUT_TUNE_PERIOD, 3000); TEST_UTIL.startMiniCluster(1); - assertEquals(10L * 1024 * 1024, - ((PressureAwareThroughputController) TEST_UTIL.getMiniHBaseCluster().getRegionServer(0) - .getFlushThroughputController()).getMaxThroughput(), EPSILON); Connection conn = ConnectionFactory.createConnection(conf); try { HTableDescriptor htd = new HTableDescriptor(tableName); @@ -181,6 +178,12 @@ public class TestFlushWithThroughputController { HRegionServer regionServer = TEST_UTIL.getRSForFirstRegionInTable(tableName); PressureAwareFlushThroughputController throughputController = (PressureAwareFlushThroughputController) regionServer.getFlushThroughputController(); + for (Region region : regionServer.getOnlineRegions()) { + region.flush(true); + } + assertEquals(0.0, regionServer.getFlushPressure(), EPSILON); + Thread.sleep(5000); + assertEquals(10L * 1024 * 1024, throughputController.getMaxThroughput(), EPSILON); Table table = conn.getTable(tableName); Random rand = new Random(); for (int i = 0; i < 10; i++) {