From 2f68a2c06b325f9b64b46671c35c251926042513 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Fri, 24 May 2013 17:02:53 +0000 Subject: [PATCH] HBASE-8583 Create a new IntegrationTestBigLinkedListWithChaosMonkey git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1486118 13f79535-47bb-0310-9956-ffa450edef68 --- .../test/IntegrationTestBigLinkedList.java | 10 ++++--- .../apache/hadoop/hbase/ipc/RpcServer.java | 30 ++++++++++++++----- .../hbase/regionserver/HRegionServer.java | 2 +- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java index a8847f6d891..9eeb5c2a0d4 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java @@ -170,6 +170,8 @@ public class IntegrationTestBigLinkedList extends Configured implements Tool { private static final String GENERATOR_NUM_MAPPERS_KEY = "IntegrationTestBigLinkedList.generator.map.tasks"; + protected int NUM_SLAVES_BASE = 3; // number of slaves for the cluster + static class CINode { long key; long prev; @@ -648,7 +650,7 @@ public class IntegrationTestBigLinkedList extends Configured implements Tool { * Executes Generate and Verify in a loop. Data is not cleaned between runs, so each iteration * adds more data. */ - private static class Loop extends Configured implements Tool { + static class Loop extends Configured implements Tool { private static final Log LOG = LogFactory.getLog(Loop.class); @@ -916,12 +918,12 @@ public class IntegrationTestBigLinkedList extends Configured implements Tool { return node; } - private IntegrationTestingUtility util; + protected IntegrationTestingUtility util; @Before public void setUp() throws Exception { util = getTestingUtil(); - util.initializeCluster(3); + util.initializeCluster(this.NUM_SLAVES_BASE); this.setConf(util.getConfiguration()); } @@ -939,7 +941,7 @@ public class IntegrationTestBigLinkedList extends Configured implements Tool { org.junit.Assert.assertEquals(0, ret); } - private IntegrationTestingUtility getTestingUtil() { + protected IntegrationTestingUtility getTestingUtil() { if (this.util == null) { if (getConf() == null) { this.util = new IntegrationTestingUtility(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java index dd3dcb17405..585bbdbd4de 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java @@ -290,12 +290,27 @@ public class RpcServer implements RpcServerInterface { @Override public String toString() { - String serviceName = this.connection.service != null? - this.connection.service.getDescriptorForType().getName(): "null"; - return "callId: " + this.id + " service: " + serviceName + " methodName: " + - ((this.md != null)? this.md.getName(): null) + " param: " + - (this.param != null? IPCUtil.getRequestShortTextFormat(this.param): "") + - " connection: " + connection.toString(); + return toShortString() + " param: " + + (this.param != null ? IPCUtil.getRequestShortTextFormat(this.param) : ""); + } + + /* + * Short string representation without param info because param itself could be huge depends on + * the payload of a command + */ + String toShortString() { + String serviceName = this.connection.service != null ? this.connection.service + .getDescriptorForType().getName() : "null"; + StringBuilder sb = new StringBuilder(); + sb.append("callId: "); + sb.append(this.id); + sb.append(" service: "); + sb.append(serviceName); + sb.append(" methodName: "); + sb.append((this.md != null) ? this.md.getName() : ""); + sb.append(" connection: "); + sb.append(connection.toString()); + return sb.toString(); } protected synchronized void setSaslTokenResponse(ByteBuffer response) { @@ -986,7 +1001,8 @@ public class RpcServer implements RpcServerInterface { } } finally { if (error && call != null) { - LOG.warn(getName() + call.toString() + ": output error"); + LOG.warn(getName() + ((call.size > 512) ? call.toShortString() : call.toString()) + + ": output error"); done = true; // error. no more data for this channel. closeConnection(call.connection); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 5119dc00126..10f4b20d34d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -914,7 +914,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa } //fsOk flag may be changed when closing regions throws exception. - if (!this.killed && this.fsOk) { + if (this.fsOk) { closeWAL(!abortRequested); }