Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3F63B200BDB for ; Mon, 28 Nov 2016 04:07:33 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3DE1B160B20; Mon, 28 Nov 2016 03:07:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 864F5160B12 for ; Mon, 28 Nov 2016 04:07:32 +0100 (CET) Received: (qmail 63753 invoked by uid 500); 28 Nov 2016 03:07:31 -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 63740 invoked by uid 99); 28 Nov 2016 03:07:30 -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; Mon, 28 Nov 2016 03:07:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4A09AE36CA; Mon, 28 Nov 2016 03:07:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jerryjch@apache.org To: commits@hbase.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-17116 [PerformanceEvaluation] Add option to configure block size (Yi Liang) Date: Mon, 28 Nov 2016 03:07:30 +0000 (UTC) archived-at: Mon, 28 Nov 2016 03:07:33 -0000 Repository: hbase Updated Branches: refs/heads/master 8204337b5 -> 4771c217c HBASE-17116 [PerformanceEvaluation] Add option to configure block size (Yi Liang) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4771c217 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4771c217 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4771c217 Branch: refs/heads/master Commit: 4771c217cdcfa9daf9854635b2aa8c7ccc71cd0d Parents: 8204337 Author: Jerry He Authored: Sun Nov 27 19:04:32 2016 -0800 Committer: Jerry He Committed: Sun Nov 27 19:04:32 2016 -0800 ---------------------------------------------------------------------- .../hadoop/hbase/PerformanceEvaluation.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/4771c217/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 53c126d..d50bf6b 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 @@ -371,6 +371,7 @@ public class PerformanceEvaluation extends Configured implements Tool { family.setDataBlockEncoding(opts.blockEncoding); family.setCompressionType(opts.compression); family.setBloomFilterType(opts.bloomType); + family.setBlocksize(opts.blockSize); if (opts.inMemoryCF) { family.setInMemory(true); } @@ -625,6 +626,7 @@ public class PerformanceEvaluation extends Configured implements Tool { String splitPolicy = null; Compression.Algorithm compression = Compression.Algorithm.NONE; BloomType bloomType = BloomType.ROW; + int blockSize = HConstants.DEFAULT_BLOCKSIZE; DataBlockEncoding blockEncoding = DataBlockEncoding.NONE; boolean valueRandom = false; boolean valueZipf = false; @@ -670,6 +672,7 @@ public class PerformanceEvaluation extends Configured implements Tool { this.blockEncoding = that.blockEncoding; this.filterAll = that.filterAll; this.bloomType = that.bloomType; + this.blockSize = that.blockSize; this.valueRandom = that.valueRandom; this.valueZipf = that.valueZipf; this.valueSize = that.valueSize; @@ -834,6 +837,10 @@ public class PerformanceEvaluation extends Configured implements Tool { this.bloomType = bloomType; } + public void setBlockSize(int blockSize) { + this.blockSize = blockSize; + } + public void setBlockEncoding(DataBlockEncoding blockEncoding) { this.blockEncoding = blockEncoding; } @@ -950,6 +957,10 @@ public class PerformanceEvaluation extends Configured implements Tool { return bloomType; } + public int getBlockSize() { + return blockSize; + } + public boolean isOneCon() { return oneCon; } @@ -1881,8 +1892,9 @@ public class PerformanceEvaluation extends Configured implements Tool { 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 memory. Default: false"); - System.err.println(" bloomFilter Bloom filter type, one of " + System.err.println(" bloomFilter Bloom filter type, one of " + Arrays.toString(BloomType.values())); + System.err.println(" blockSize Blocksize to use when writing out hfiles. "); 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"); @@ -2084,6 +2096,11 @@ public class PerformanceEvaluation extends Configured implements Tool { continue; } + final String blockSize = "--blockSize="; + if(cmd.startsWith(blockSize) ) { + opts.blockSize = Integer.parseInt(cmd.substring(blockSize.length())); + } + final String valueSize = "--valueSize="; if (cmd.startsWith(valueSize)) { opts.valueSize = Integer.parseInt(cmd.substring(valueSize.length()));