hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject [04/50] [abbrv] hbase git commit: HBASE-13277 add mob_threshold option to load test tool
Date Wed, 22 Jul 2015 19:52:22 GMT
HBASE-13277 add mob_threshold option to load test tool


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

Branch: refs/heads/master
Commit: 753ceb6e7641d2b5b2e32d51742bc5246aa48b90
Parents: aedd0eb
Author: Jonathan M Hsieh <jmhsieh@apache.org>
Authored: Fri Mar 20 09:48:04 2015 -0700
Committer: Jonathan M Hsieh <jmhsieh@apache.org>
Committed: Fri Mar 20 09:48:04 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/util/LoadTestTool.java  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/753ceb6e/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
index 90e07b3..33efe86 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
@@ -169,6 +169,10 @@ public class LoadTestTool extends AbstractHBaseTool {
   protected static final String OPT_REGION_REPLICA_ID_USAGE =
       "Region replica id to do the reads from";
 
+  public static final String OPT_MOB_THRESHOLD = "mob_threshold";
+  protected static final String OPT_MOB_THRESHOLD_USAGE =
+      "Desired cell size to exceed in bytes that will use the MOB write path";
+
   protected static final long DEFAULT_START_KEY = 0;
 
   /** This will be removed as we factor out the dependency on command line */
@@ -221,6 +225,8 @@ public class LoadTestTool extends AbstractHBaseTool {
   private int regionReplication = -1; // not set
   private int regionReplicaId = -1; // not set
 
+  private int mobThreshold = -1; // not set
+
   // TODO: refactor LoadTestToolImpl somewhere to make the usage from tests less bad,
   //       console tool itself should only be used from console.
   protected boolean isSkipInit = false;
@@ -281,6 +287,10 @@ public class LoadTestTool extends AbstractHBaseTool {
           User.getCurrent().getShortName(),
           new SecretKeySpec(keyBytes, cipher.getName())));
       }
+      if (mobThreshold >= 0) {
+        columnDesc.setMobEnabled(true);
+        columnDesc.setMobThreshold(mobThreshold);
+      }
       if (isNewCf) {
         admin.addColumn(tableName, columnDesc);
       } else {
@@ -343,6 +353,7 @@ public class LoadTestTool extends AbstractHBaseTool {
     addOptWithArg(OPT_NUM_REGIONS_PER_SERVER, OPT_NUM_REGIONS_PER_SERVER_USAGE);
     addOptWithArg(OPT_REGION_REPLICATION, OPT_REGION_REPLICATION_USAGE);
     addOptWithArg(OPT_REGION_REPLICA_ID, OPT_REGION_REPLICA_ID_USAGE);
+    addOptWithArg(OPT_MOB_THRESHOLD, OPT_MOB_THRESHOLD_USAGE);
   }
 
   @Override
@@ -401,6 +412,11 @@ public class LoadTestTool extends AbstractHBaseTool {
 
       isMultiPut = cmd.hasOption(OPT_MULTIPUT);
 
+      mobThreshold = -1;
+      if (cmd.hasOption(OPT_MOB_THRESHOLD)) {
+        mobThreshold = Integer.parseInt(cmd.getOptionValue(OPT_MOB_THRESHOLD));
+      }
+
       System.out.println("Multi-puts: " + isMultiPut);
       System.out.println("Columns per key: " + minColsPerKey + ".."
           + maxColsPerKey);


Mime
View raw message