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 A9F85200B85 for ; Thu, 1 Sep 2016 05:52:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 94AC2160AB5; Thu, 1 Sep 2016 03:52:40 +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 B48A7160AB4 for ; Thu, 1 Sep 2016 05:52:39 +0200 (CEST) Received: (qmail 24164 invoked by uid 500); 1 Sep 2016 03:52:28 -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 24155 invoked by uid 99); 1 Sep 2016 03:52:28 -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; Thu, 01 Sep 2016 03:52:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B5798DFF56; Thu, 1 Sep 2016 03:52:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: zhangduo@apache.org To: commits@hbase.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-16526 Addendum add missing stuffs Date: Thu, 1 Sep 2016 03:52:28 +0000 (UTC) archived-at: Thu, 01 Sep 2016 03:52:45 -0000 Repository: hbase Updated Branches: refs/heads/master fe22208f0 -> e30a66b94 HBASE-16526 Addendum add missing stuffs Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/e30a66b9 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/e30a66b9 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/e30a66b9 Branch: refs/heads/master Commit: e30a66b9443618f04ad8cb0aee96ac77b174338b Parents: fe22208 Author: zhangduo Authored: Thu Sep 1 11:48:06 2016 +0800 Committer: zhangduo Committed: Thu Sep 1 11:48:35 2016 +0800 ---------------------------------------------------------------------- .../hadoop/hbase/ipc/TestCellBlockBuilder.java | 28 ++++++++++---------- .../apache/hadoop/hbase/ipc/TestIPCUtil.java | 4 +++ .../hbase/ipc/IntegrationTestRpcClient.java | 8 +----- 3 files changed, 19 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/e30a66b9/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java index b780b95..60ef357 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java @@ -67,19 +67,19 @@ public class TestCellBlockBuilder { doBuildCellBlockUndoCellBlock(this.builder, new KeyValueCodec(), new GzipCodec()); } - static void doBuildCellBlockUndoCellBlock(final CellBlockBuilder util, final Codec codec, + static void doBuildCellBlockUndoCellBlock(final CellBlockBuilder builder, final Codec codec, final CompressionCodec compressor) throws IOException { - doBuildCellBlockUndoCellBlock(util, codec, compressor, 10, 1, false); + doBuildCellBlockUndoCellBlock(builder, codec, compressor, 10, 1, false); } - static void doBuildCellBlockUndoCellBlock(final CellBlockBuilder util, final Codec codec, + static void doBuildCellBlockUndoCellBlock(final CellBlockBuilder builder, final Codec codec, final CompressionCodec compressor, final int count, final int size, final boolean sized) throws IOException { Cell[] cells = getCells(count, size); CellScanner cellScanner = sized ? getSizedCellScanner(cells) : CellUtil.createCellScanner(Arrays.asList(cells).iterator()); - ByteBuffer bb = util.buildCellBlock(codec, compressor, cellScanner); - cellScanner = util.createCellScannerReusingBuffers(codec, compressor, bb); + ByteBuffer bb = builder.buildCellBlock(codec, compressor, cellScanner); + cellScanner = builder.createCellScannerReusingBuffers(codec, compressor, bb); int i = 0; while (cellScanner.advance()) { i++; @@ -143,13 +143,13 @@ public class TestCellBlockBuilder { System.exit(errCode); } - private static void timerTests(final CellBlockBuilder util, final int count, final int size, + private static void timerTests(final CellBlockBuilder builder, final int count, final int size, final Codec codec, final CompressionCodec compressor) throws IOException { final int cycles = 1000; StopWatch timer = new StopWatch(); timer.start(); for (int i = 0; i < cycles; i++) { - timerTest(util, timer, count, size, codec, compressor, false); + timerTest(builder, timer, count, size, codec, compressor, false); } timer.stop(); LOG.info("Codec=" + codec + ", compression=" + compressor + ", sized=" + false + ", count=" @@ -157,17 +157,17 @@ public class TestCellBlockBuilder { timer.reset(); timer.start(); for (int i = 0; i < cycles; i++) { - timerTest(util, timer, count, size, codec, compressor, true); + timerTest(builder, timer, count, size, codec, compressor, true); } timer.stop(); LOG.info("Codec=" + codec + ", compression=" + compressor + ", sized=" + true + ", count=" + count + ", size=" + size + ", + took=" + timer.getTime() + "ms"); } - private static void timerTest(final CellBlockBuilder util, final StopWatch timer, final int count, + private static void timerTest(final CellBlockBuilder builder, final StopWatch timer, final int count, final int size, final Codec codec, final CompressionCodec compressor, final boolean sized) throws IOException { - doBuildCellBlockUndoCellBlock(util, codec, compressor, count, size, sized); + doBuildCellBlockUndoCellBlock(builder, codec, compressor, count, size, sized); } /** @@ -187,10 +187,10 @@ public class TestCellBlockBuilder { usage(1); } } - CellBlockBuilder util = new CellBlockBuilder(HBaseConfiguration.create()); + CellBlockBuilder buildr = new CellBlockBuilder(HBaseConfiguration.create()); ((Log4JLogger) CellBlockBuilder.LOG).getLogger().setLevel(Level.ALL); - timerTests(util, count, size, new KeyValueCodec(), null); - timerTests(util, count, size, new KeyValueCodec(), new DefaultCodec()); - timerTests(util, count, size, new KeyValueCodec(), new GzipCodec()); + timerTests(buildr, count, size, new KeyValueCodec(), null); + timerTests(buildr, count, size, new KeyValueCodec(), new DefaultCodec()); + timerTests(buildr, count, size, new KeyValueCodec(), new GzipCodec()); } } http://git-wip-us.apache.org/repos/asf/hbase/blob/e30a66b9/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestIPCUtil.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestIPCUtil.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestIPCUtil.java index ef534c0..7c4ac02 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestIPCUtil.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestIPCUtil.java @@ -25,8 +25,12 @@ import java.net.InetSocketAddress; import java.net.SocketTimeoutException; import org.apache.hadoop.hbase.exceptions.ConnectionClosingException; +import org.apache.hadoop.hbase.testclassification.ClientTests; +import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.Test; +import org.junit.experimental.categories.Category; +@Category({ ClientTests.class, SmallTests.class }) public class TestIPCUtil { @Test http://git-wip-us.apache.org/repos/asf/hbase/blob/e30a66b9/hbase-it/src/test/java/org/apache/hadoop/hbase/ipc/IntegrationTestRpcClient.java ---------------------------------------------------------------------- diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/ipc/IntegrationTestRpcClient.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/ipc/IntegrationTestRpcClient.java index 65d8d8b..28c19ad 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/ipc/IntegrationTestRpcClient.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/ipc/IntegrationTestRpcClient.java @@ -53,7 +53,6 @@ import org.apache.hadoop.hbase.ipc.protobuf.generated.TestProtos.EchoRequestProt import org.apache.hadoop.hbase.ipc.protobuf.generated.TestProtos.EchoResponseProto; import org.apache.hadoop.hbase.ipc.protobuf.generated.TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface; import org.apache.hadoop.hbase.monitoring.MonitoredRPCHandler; -import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.testclassification.IntegrationTests; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.hbase.util.Threads; @@ -284,13 +283,8 @@ public class IntegrationTestRpcClient { EchoResponseProto ret; TestRpcServer server = cluster.getRandomServer(); try { - User user = User.getCurrent(); - InetSocketAddress address = server.getListenerAddress(); - if (address == null) { - throw new IOException("Listener channel is closed"); - } sending.set(true); - BlockingInterface stub = newBlockingStub(rpcClient, address, user); + BlockingInterface stub = newBlockingStub(rpcClient, server.getListenerAddress()); ret = stub.echo(null, param); } catch (Exception e) { LOG.warn(e);