Author: hairong
Date: Tue Jan 26 22:52:05 2010
New Revision: 903468
URL: http://svn.apache.org/viewvc?rev=903468&view=rev
Log:
Revert commit 903015 because it was tagged with the wrong jira number
HADOOP-6459.
Modified:
hadoop/common/trunk/CHANGES.txt
hadoop/common/trunk/src/java/org/apache/hadoop/ipc/Client.java
hadoop/common/trunk/src/test/core/org/apache/hadoop/ipc/TestIPC.java
Modified: hadoop/common/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=903468&r1=903467&r2=903468&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Tue Jan 26 22:52:05 2010
@@ -1320,9 +1320,6 @@
HADOOP-6315. Avoid incorrect use of BuiltInflater/BuiltInDeflater in
GzipCodec. (Aaron Kimball via cdouglas)
- HADOOP-6498. IPC client bug may cause rpc call hang. (Ruyue Ma and hairong
- via hairong)
-
Release 0.20.1 - 2009-09-01
INCOMPATIBLE CHANGES
Modified: hadoop/common/trunk/src/java/org/apache/hadoop/ipc/Client.java
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/ipc/Client.java?rev=903468&r1=903467&r2=903468&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/ipc/Client.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/ipc/Client.java Tue Jan 26
22:52:05 2010
@@ -529,14 +529,13 @@
if (LOG.isDebugEnabled())
LOG.debug(getName() + " got value #" + id);
- Call call = calls.get(id);
+ Call call = calls.remove(id);
int state = in.readInt(); // read call status
if (state == Status.SUCCESS.state) {
Writable value = ReflectionUtils.newInstance(valueClass, conf);
value.readFields(in); // read value
call.setValue(value);
- calls.remove(id);
} else if (state == Status.ERROR.state) {
call.setException(new RemoteException(WritableUtils.readString(in),
WritableUtils.readString(in)));
Modified: hadoop/common/trunk/src/test/core/org/apache/hadoop/ipc/TestIPC.java
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/ipc/TestIPC.java?rev=903468&r1=903467&r2=903468&view=diff
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/ipc/TestIPC.java
(original)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/ipc/TestIPC.java Tue
Jan 26 22:52:05 2010
@@ -26,7 +26,6 @@
import org.apache.hadoop.net.NetUtils;
import java.util.Random;
-import java.io.DataInput;
import java.io.IOException;
import java.net.InetSocketAddress;
@@ -89,7 +88,7 @@
try {
LongWritable param = new LongWritable(RANDOM.nextLong());
LongWritable value =
- (LongWritable)client.call(param, server, null, null);
+ (LongWritable)client.call(param, server);
if (!param.equals(value)) {
LOG.fatal("Call failed!");
failed = true;
@@ -122,7 +121,7 @@
Writable[] params = new Writable[addresses.length];
for (int j = 0; j < addresses.length; j++)
params[j] = new LongWritable(RANDOM.nextLong());
- Writable[] values = client.call(params, addresses, null, null);
+ Writable[] values = client.call(params, addresses);
for (int j = 0; j < addresses.length; j++) {
if (!params[j].equals(values[j])) {
LOG.fatal("Call failed!");
@@ -217,7 +216,7 @@
InetSocketAddress address = new InetSocketAddress("127.0.0.1", 10);
try {
client.call(new LongWritable(RANDOM.nextLong()),
- address, null, null);
+ address);
fail("Expected an exception to have been thrown");
} catch (IOException e) {
String message = e.getMessage();
@@ -232,41 +231,6 @@
}
}
- private static class LongErrorWritable extends LongWritable {
- private final static String ERR_MSG =
- "Come across an exception while reading";
-
- LongErrorWritable() {}
-
- LongErrorWritable(long longValue) {
- super(longValue);
- }
-
- public void readFields(DataInput in) throws IOException {
- super.readFields(in);
- throw new IOException(ERR_MSG);
- }
- }
- public void testErrorClient() throws Exception {
- // start server
- Server server = new TestServer(1, false);
- InetSocketAddress addr = NetUtils.getConnectAddress(server);
- server.start();
-
- // start client
- Client client = new Client(LongErrorWritable.class, conf);
- try {
- client.call(new LongErrorWritable(RANDOM.nextLong()),
- addr, null, null);
- fail("Expected an exception to have been thrown");
- } catch (IOException e) {
- // check error
- Throwable cause = e.getCause();
- assertTrue(cause instanceof IOException);
- assertEquals(LongErrorWritable.ERR_MSG, cause.getMessage());
- }
- }
-
public static void main(String[] args) throws Exception {