You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ra...@apache.org on 2015/04/02 12:44:17 UTC

hbase git commit: HBASE-13370 - PE tool could give option for using Explicit Column Tracker which leads to seeks (Ram)

Repository: hbase
Updated Branches:
  refs/heads/master 2392a3e43 -> f210c2ebb


HBASE-13370 - PE tool could give option for using Explicit Column Tracker
which leads to seeks (Ram)


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

Branch: refs/heads/master
Commit: f210c2ebba31dd79ffdf819a2c5e45dcd5a36ace
Parents: 2392a3e
Author: unknown <rs...@rsvasude-MOBL2.gar.corp.intel.com>
Authored: Thu Apr 2 16:11:23 2015 +0530
Committer: unknown <rs...@rsvasude-MOBL2.gar.corp.intel.com>
Committed: Thu Apr 2 16:13:23 2015 +0530

----------------------------------------------------------------------
 .../hadoop/hbase/PerformanceEvaluation.java     | 41 +++++++++++++++++---
 1 file changed, 35 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f210c2eb/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
index 2e7afa5..d51f698 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
@@ -610,6 +610,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
     int valueSize = DEFAULT_VALUE_LENGTH;
     int period = (this.perClientRunRows / 10) == 0? perClientRunRows: perClientRunRows / 10;
     int cycles = 1;
+    boolean addColumns = true;
 
     public TestOptions() {}
 
@@ -651,6 +652,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
       this.period = that.period;
       this.randomSleep = that.randomSleep;
       this.measureAfter = that.measureAfter;
+      this.addColumns = that.addColumns;
     }
 
     public int getCycles() {
@@ -916,6 +918,14 @@ public class PerformanceEvaluation extends Configured implements Tool {
     public void setMeasureAfter(int measureAfter) {
       this.measureAfter = measureAfter;
     }
+
+    public boolean getAddColumns() {
+      return addColumns;
+    }
+
+    public void setAddColumns(boolean addColumns) {
+      this.addColumns = addColumns;
+    }
   }
 
   /*
@@ -1181,7 +1191,9 @@ public class PerformanceEvaluation extends Configured implements Tool {
     void testRow(final int i) throws IOException {
       Scan scan = new Scan(getRandomRow(this.rand, opts.totalRows));
       FilterList list = new FilterList();
-      scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      if (opts.addColumns) {
+        scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      }
       if (opts.filterAll) {
         list.addFilter(new FilterAllFilter());
       }
@@ -1214,7 +1226,9 @@ public class PerformanceEvaluation extends Configured implements Tool {
       if (opts.filterAll) {
         scan.setFilter(new FilterAllFilter());
       }
-      scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      if (opts.addColumns) {
+        scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      }
       Result r = null;
       int count = 0;
       ResultScanner s = this.table.getScanner(scan);
@@ -1310,7 +1324,9 @@ public class PerformanceEvaluation extends Configured implements Tool {
         Thread.sleep(rd.nextInt(opts.randomSleep));
       }
       Get get = new Get(getRandomRow(this.rand, opts.totalRows));
-      get.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      if (opts.addColumns) {
+        get.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      }
       if (opts.filterAll) {
         get.setFilter(new FilterAllFilter());
       }
@@ -1395,7 +1411,9 @@ public class PerformanceEvaluation extends Configured implements Tool {
       if (this.testScanner == null) {
         Scan scan = new Scan(format(opts.startRow));
         scan.setCaching(30);
-        scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+        if (opts.addColumns) {
+          scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+        }
         if (opts.filterAll) {
           scan.setFilter(new FilterAllFilter());
         }
@@ -1415,7 +1433,9 @@ public class PerformanceEvaluation extends Configured implements Tool {
     @Override
     void testRow(final int i) throws IOException {
       Get get = new Get(format(i));
-      get.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      if (opts.addColumns) {
+        get.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      }
       if (opts.filterAll) {
         get.setFilter(new FilterAllFilter());
       }
@@ -1486,7 +1506,9 @@ public class PerformanceEvaluation extends Configured implements Tool {
         list.addFilter(new FilterAllFilter());
       }
       Scan scan = new Scan();
-      scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      if (opts.addColumns) {
+        scan.addColumn(FAMILY_NAME, QUALIFIER_NAME);
+      }
       scan.setFilter(list);
       return scan;
     }
@@ -1677,6 +1699,7 @@ public class PerformanceEvaluation extends Configured implements Tool {
       "Default: opts.perClientRunRows / 10");
     System.err.println(" multiGet        Batch gets together into groups of N. Only supported " +
       "by randomRead. Default: disabled");
+    System.err.println(" addColumns      Adds columns to scans/gets explicitly. Default: true");
     System.err.println(" replicas        Enable region replica testing. Defaults: 1.");
     System.err.println(" cycles          How many times to cycle the test. Defaults: 1.");
     System.err.println(" splitPolicy     Specify a custom RegionSplitPolicy for the table.");
@@ -1906,6 +1929,12 @@ public class PerformanceEvaluation extends Configured implements Tool {
         continue;
       }
 
+      final String addColumns = "--addColumns=";
+      if (cmd.startsWith(addColumns)) {
+        opts.addColumns = Boolean.parseBoolean(cmd.substring(addColumns.length()));
+        continue;
+      }
+
       if (isCommandClass(cmd)) {
         opts.cmdName = cmd;
         opts.numClientThreads = Integer.parseInt(args.remove());