Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D525F102A7 for ; Thu, 5 Mar 2015 08:13:26 +0000 (UTC) Received: (qmail 58925 invoked by uid 500); 5 Mar 2015 08:13:18 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 58880 invoked by uid 500); 5 Mar 2015 08:13:18 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 58871 invoked by uid 99); 5 Mar 2015 08:13:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Mar 2015 08:13:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9ED8CE03AF; Thu, 5 Mar 2015 08:13:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jmhsieh@apache.org To: commits@hbase.apache.org Message-Id: <41e4776fbfe047cf825b4661b4c84ab5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-13154 add support for mob in TestAcidGuarantees and IntegrationTestAcidGuarantees Date: Thu, 5 Mar 2015 08:13:18 +0000 (UTC) Repository: hbase Updated Branches: refs/heads/hbase-11339 47ed5cd7e -> 2124d3df7 HBASE-13154 add support for mob in TestAcidGuarantees and IntegrationTestAcidGuarantees Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2124d3df Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2124d3df Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2124d3df Branch: refs/heads/hbase-11339 Commit: 2124d3df7070045fcd43bffd7b6036dc91a11b40 Parents: 47ed5cd Author: Jonathan M Hsieh Authored: Tue Mar 3 09:20:03 2015 -0800 Committer: Jonathan M Hsieh Committed: Thu Mar 5 00:09:05 2015 -0800 ---------------------------------------------------------------------- .../hbase/IntegrationTestAcidGuarantees.java | 3 +- .../apache/hadoop/hbase/TestAcidGuarantees.java | 66 +++++++++++++++++++- 2 files changed, 65 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/2124d3df/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestAcidGuarantees.java ---------------------------------------------------------------------- diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestAcidGuarantees.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestAcidGuarantees.java index 7250eb3..b2f74ea 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestAcidGuarantees.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestAcidGuarantees.java @@ -55,7 +55,8 @@ public class IntegrationTestAcidGuarantees extends IntegrationTestBase { int numGetters = c.getInt("numGetters", 2); int numScanners = c.getInt("numScanners", 2); int numUniqueRows = c.getInt("numUniqueRows", 3); - tag.runTestAtomicity(millis, numWriters, numGetters, numScanners, numUniqueRows, true); + boolean useMob = c.getBoolean("useMob",false); + tag.runTestAtomicity(millis, numWriters, numGetters, numScanners, numUniqueRows, true, useMob); return 0; } http://git-wip-us.apache.org/repos/asf/hbase/blob/2124d3df/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java index 5659f6b..ebaa92f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestAcidGuarantees.java @@ -77,12 +77,21 @@ public class TestAcidGuarantees implements Tool { // when run as main private Configuration conf; - private void createTableIfMissing() + private void createTableIfMissing(boolean useMob) throws IOException { try { util.createTable(TABLE_NAME, FAMILIES); } catch (TableExistsException tee) { } + + if (useMob) { + HTableDescriptor htd = util.getHBaseAdmin().getTableDescriptor(TABLE_NAME); + HColumnDescriptor hcd = htd.getColumnFamilies()[0]; + // force mob enabled such that all data is mob data + hcd.setMobEnabled(true); + hcd.setMobThreshold(4); + util.getHBaseAdmin().modifyColumn(TABLE_NAME, hcd); + } } public TestAcidGuarantees() { @@ -92,6 +101,7 @@ public class TestAcidGuarantees implements Tool { // prevent aggressive region split conf.set(HConstants.HBASE_REGION_SPLIT_POLICY_KEY, ConstantSizeRegionSplitPolicy.class.getName()); + conf.setInt("hfile.format.version", 3); // for mob tests util = new HBaseTestingUtility(conf); } @@ -267,7 +277,19 @@ public class TestAcidGuarantees implements Tool { int numScanners, int numUniqueRows, final boolean systemTest) throws Exception { - createTableIfMissing(); + runTestAtomicity(millisToRun, numWriters, numGetters, numScanners, numUniqueRows, systemTest, + false); + } + + public void runTestAtomicity(long millisToRun, + int numWriters, + int numGetters, + int numScanners, + int numUniqueRows, + final boolean systemTest, + final boolean useMob) throws Exception { + + createTableIfMissing(useMob); TestContext ctx = new TestContext(util.getConfiguration()); byte rows[][] = new byte[numUniqueRows][]; @@ -367,6 +389,42 @@ public class TestAcidGuarantees implements Tool { } } + @Test + public void testMobGetAtomicity() throws Exception { + util.startMiniCluster(1); + try { + boolean systemTest = false; + boolean useMob = true; + runTestAtomicity(20000, 5, 5, 0, 3, systemTest, useMob); + } finally { + util.shutdownMiniCluster(); + } + } + + @Test + public void testMobScanAtomicity() throws Exception { + util.startMiniCluster(1); + try { + boolean systemTest = false; + boolean useMob = true; + runTestAtomicity(20000, 5, 0, 5, 3, systemTest, useMob); + } finally { + util.shutdownMiniCluster(); + } + } + + @Test + public void testMobMixedAtomicity() throws Exception { + util.startMiniCluster(1); + try { + boolean systemTest = false; + boolean useMob = true; + runTestAtomicity(20000, 5, 2, 2, 3, systemTest, useMob); + } finally { + util.shutdownMiniCluster(); + } + } + //////////////////////////////////////////////////////////////////////////// // Tool interface //////////////////////////////////////////////////////////////////////////// @@ -389,7 +447,9 @@ public class TestAcidGuarantees implements Tool { int numGetters = c.getInt("numGetters", 2); int numScanners = c.getInt("numScanners", 2); int numUniqueRows = c.getInt("numUniqueRows", 3); - runTestAtomicity(millis, numWriters, numGetters, numScanners, numUniqueRows, true); + boolean useMob = c.getBoolean("useMob",false); + assert useMob && c.getInt("hfile.format.version", 2) == 3 : "Mob runs must use hfile v3"; + runTestAtomicity(millis, numWriters, numGetters, numScanners, numUniqueRows, true, useMob); return 0; }