From 71c8cd5b1fe55b97becec228c13df6dd9d966f95 Mon Sep 17 00:00:00 2001 From: Ramkrishna Date: Mon, 20 Jun 2016 16:29:24 +0530 Subject: [PATCH] HBASE-16042 Add support in PE tool for InMemory Compaction (Ram) --- .../hadoop/hbase/PerformanceEvaluation.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) 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 7a68359cf80..f673b83e03a 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 @@ -374,6 +374,9 @@ public class PerformanceEvaluation extends Configured implements Tool { if (opts.inMemoryCF) { family.setInMemory(true); } + if(opts.inMemoryCompaction) { + family.setInMemoryCompaction(true); + } desc.addFamily(family); if (opts.replicas != DEFAULT_OPTS.replicas) { desc.setRegionReplication(opts.replicas); @@ -630,6 +633,7 @@ public class PerformanceEvaluation extends Configured implements Tool { int columns = 1; int caching = 30; boolean addColumns = true; + boolean inMemoryCompaction = false; public TestOptions() {} @@ -674,6 +678,7 @@ public class PerformanceEvaluation extends Configured implements Tool { this.addColumns = that.addColumns; this.columns = that.columns; this.caching = that.caching; + this.inMemoryCompaction = that.inMemoryCompaction; } public int getCaching() { @@ -963,6 +968,14 @@ public class PerformanceEvaluation extends Configured implements Tool { public void setAddColumns(boolean addColumns) { this.addColumns = addColumns; } + + public void setInMemoryCompaction(boolean inMemoryCompaction) { + this.inMemoryCompaction = inMemoryCompaction; + } + + public boolean getInMemoryCompaction() { + return this.inMemoryCompaction; + } } /* @@ -1869,6 +1882,8 @@ public class PerformanceEvaluation extends Configured implements Tool { "from memory. Default: false"); System.err.println(" bloomFilter Bloom filter type, one of " + Arrays.toString(BloomType.values())); + System.err.println(" inmemoryCompaction Makes the column family to do inmemory flushes/compactions. " + + "Uses the CompactingMemstore"); 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(" randomSleep Do a random sleep before each get between 0 and entered value. Defaults: 0"); @@ -2104,6 +2119,12 @@ public class PerformanceEvaluation extends Configured implements Tool { continue; } + final String inMemoryCompaction = "--inmemoryCompaction="; + if (cmd.startsWith(inMemoryCompaction)) { + opts.inMemoryCompaction = Boolean.parseBoolean(cmd.substring(inMemoryCompaction.length())); + continue; + } + final String columns = "--columns="; if (cmd.startsWith(columns)) { opts.columns = Integer.parseInt(cmd.substring(columns.length()));