hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject svn commit: r1485780 - in /hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase: PerformanceEvaluation.java util/LoadTestTool.java
Date Thu, 23 May 2013 17:07:08 GMT
Author: ramkrishna
Date: Thu May 23 17:07:08 2013
New Revision: 1485780

URL: http://svn.apache.org/r1485780
Log:
HBASE-8235-Adding inmemory CF attribute to LoadTest and PerformanceEvaluation tool (Ram)


Modified:
    hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
    hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java?rev=1485780&r1=1485779&r2=1485780&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java
Thu May 23 17:07:08 2013
@@ -131,6 +131,7 @@ public class PerformanceEvaluation exten
   private DataBlockEncoding blockEncoding = DataBlockEncoding.NONE;
   private boolean flushCommits = true;
   private boolean writeToWAL = true;
+  private boolean inMemoryCF = false;
   private int presplitRegions = 0;
 
   private static final Path PERF_EVAL_DIR = new Path("performance_evaluation");
@@ -510,6 +511,9 @@ public class PerformanceEvaluation exten
       HColumnDescriptor family = new HColumnDescriptor(FAMILY_NAME);
       family.setDataBlockEncoding(blockEncoding);
       family.setCompressionType(compression);
+      if (inMemoryCF) {
+        family.setInMemory(true);
+      }
       TABLE_DESCRIPTOR.addFamily(family);
     }
     return TABLE_DESCRIPTOR;
@@ -1292,6 +1296,9 @@ public class PerformanceEvaluation exten
     System.err.println(" flushCommits    Used to determine if the test should flush the table.
 Default: false");
     System.err.println(" writeToWAL      Set writeToWAL on puts. Default: True");
     System.err.println(" presplit        Create presplit table. Recommended for accurate
perf analysis (see guide).  Default: disabled");
+    System.err
+        .println(" inmemory        Tries to keep the HFiles of the CF inmemory as far as
possible.  Not " +
+        		"guaranteed that reads are always served from inmemory.  Default: false");
     System.err.println();
     System.err.println(" Note: -D properties will be applied to the conf used. ");
     System.err.println("  For example: ");
@@ -1396,7 +1403,13 @@ public class PerformanceEvaluation exten
           this.presplitRegions = Integer.parseInt(cmd.substring(presplit.length()));
           continue;
         }
-
+        
+        final String inMemory = "--inmemory=";
+        if (cmd.startsWith(inMemory)) {
+          this.inMemoryCF = Boolean.parseBoolean(cmd.substring(inMemory.length()));
+          continue;
+        }
+        
         Class<? extends Test> cmdClass = determineCommandClass(cmd);
         if (cmdClass != null) {
           getArgs(i + 1, args);

Modified: hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java?rev=1485780&r1=1485779&r2=1485780&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
(original)
+++ hbase/branches/0.95/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
Thu May 23 17:07:08 2013
@@ -86,6 +86,10 @@ public class LoadTestTool extends Abstra
   public static final String OPT_ENCODE_IN_CACHE_ONLY_USAGE =
       "If this is specified, data blocks will only be encoded in block " +
       "cache but not on disk";
+  
+  public static final String OPT_INMEMORY = "in_memory";
+  public static final String OPT_USAGE_IN_MEMORY = "Tries to keep the HFiles of the CF "
+
+  		"inmemory as far as possible.  Not guaranteed that reads are always served from inmemory";
 
   private static final String OPT_KEY_WINDOW = "key_window";
   private static final String OPT_WRITE = "write";
@@ -116,7 +120,7 @@ public class LoadTestTool extends Abstra
   private boolean encodeInCacheOnly;
   private Compression.Algorithm compressAlgo;
   private BloomType bloomType;
-
+  private boolean inMemoryCF;
   // Writer options
   private int numWriterThreads = DEFAULT_NUM_THREADS;
   private int minColsPerKey, maxColsPerKey;
@@ -177,6 +181,9 @@ public class LoadTestTool extends Abstra
         columnDesc.setDataBlockEncoding(dataBlockEncodingAlgo);
         columnDesc.setEncodeOnDisk(!encodeInCacheOnly);
       }
+      if (inMemoryCF) {
+        columnDesc.setInMemory(inMemoryCF);
+      }
       if (isNewCf) {
         admin.addColumn(tableName, columnDesc);
       } else {
@@ -208,6 +215,7 @@ public class LoadTestTool extends Abstra
     addOptNoArg(OPT_MULTIPUT, "Whether to use multi-puts as opposed to " +
         "separate puts for every column in a row");
     addOptNoArg(OPT_ENCODE_IN_CACHE_ONLY, OPT_ENCODE_IN_CACHE_ONLY_USAGE);
+    addOptNoArg(OPT_INMEMORY, OPT_USAGE_IN_MEMORY);
 
     addOptWithArg(OPT_NUM_KEYS, "The number of keys to read/write");
     addOptWithArg(OPT_START_KEY, "The first key to read/write " +
@@ -318,6 +326,9 @@ public class LoadTestTool extends Abstra
     String bloomStr = cmd.getOptionValue(OPT_BLOOM);
     bloomType = bloomStr == null ? null :
         BloomType.valueOf(bloomStr);
+    
+    inMemoryCF = cmd.hasOption(OPT_INMEMORY);
+    
   }
 
   public void initTestTable() throws IOException {



Mime
View raw message