tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject git commit: TAJO-719: JUnit test failures. (jinho)
Date Sat, 29 Mar 2014 07:44:52 GMT
Repository: tajo
Updated Branches:
  refs/heads/branch-0.8.0 4152d0954 -> 8c2703c2d


TAJO-719: JUnit test failures. (jinho)


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/8c2703c2
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/8c2703c2
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/8c2703c2

Branch: refs/heads/branch-0.8.0
Commit: 8c2703c2d2d779f26942de23d55069f47618bd93
Parents: 4152d09
Author: jinossy <jinossy@gmail.com>
Authored: Sat Mar 29 16:44:11 2014 +0900
Committer: jinossy <jinossy@gmail.com>
Committed: Sat Mar 29 16:44:11 2014 +0900

----------------------------------------------------------------------
 CHANGES.txt                                         |  2 ++
 .../tajo/master/querymaster/QueryInProgress.java    |  4 ++--
 .../java/org/apache/tajo/rpc/NettyClientBase.java   |  4 ++++
 .../test/java/org/apache/tajo/rpc/TestAsyncRpc.java | 16 ++++++++++++++++
 .../java/org/apache/tajo/rpc/TestBlockingRpc.java   | 13 +++++++++++++
 5 files changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/8c2703c2/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3968594..faa2f81 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -292,6 +292,8 @@ Release 0.8.0 - unreleased
 
   BUG FIXES
 
+    TAJO-719: JUnit test failures. (jinho)
+
     TAJO-713: Missing INET4 in UniformRangePartition. (jihoon)
 
     TAJO-718: A group-by clause with the same columns but aliased causes

http://git-wip-us.apache.org/repos/asf/tajo/blob/8c2703c2/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryInProgress.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryInProgress.java
b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryInProgress.java
index 1b38123..e7e12a1 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryInProgress.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/master/querymaster/QueryInProgress.java
@@ -194,8 +194,8 @@ public class QueryInProgress extends CompositeService {
   private void connectQueryMaster() throws Exception {
     if(queryInfo.getQueryMasterResource() != null &&
         queryInfo.getQueryMasterResource().getAllocatedHost() != null) {
-      InetSocketAddress addr = NetUtils.createSocketAddr(
-          queryInfo.getQueryMasterHost() + ":" + queryInfo.getQueryMasterPort());
+      InetSocketAddress addr = NetUtils.createSocketAddrForHost(
+          queryInfo.getQueryMasterHost(), queryInfo.getQueryMasterPort());
       LOG.info("Connect to QueryMaster:" + addr);
       queryMasterRpc =
           RpcConnectionPool.getPool((TajoConf) getConfig()).getConnection(addr, QueryMasterProtocol.class,
true);

http://git-wip-us.apache.org/repos/asf/tajo/blob/8c2703c2/tajo-rpc/src/main/java/org/apache/tajo/rpc/NettyClientBase.java
----------------------------------------------------------------------
diff --git a/tajo-rpc/src/main/java/org/apache/tajo/rpc/NettyClientBase.java b/tajo-rpc/src/main/java/org/apache/tajo/rpc/NettyClientBase.java
index 60d3aa6..8f49e17 100644
--- a/tajo-rpc/src/main/java/org/apache/tajo/rpc/NettyClientBase.java
+++ b/tajo-rpc/src/main/java/org/apache/tajo/rpc/NettyClientBase.java
@@ -20,6 +20,7 @@ package org.apache.tajo.rpc;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.tajo.util.NetUtils;
 import org.jboss.netty.bootstrap.ClientBootstrap;
 import org.jboss.netty.channel.Channel;
 import org.jboss.netty.channel.ChannelFuture;
@@ -63,6 +64,9 @@ public abstract class NettyClientBase implements Closeable {
   }
 
   public void connect(InetSocketAddress addr) {
+    if(addr.isUnresolved()){
+       addr = NetUtils.createSocketAddr(addr.getHostName(), addr.getPort());
+    }
     this.channelFuture = bootstrap.connect(addr);
     this.channelFuture.awaitUninterruptibly();
     if (!channelFuture.isSuccess()) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/8c2703c2/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java
----------------------------------------------------------------------
diff --git a/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java b/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java
index 97bc28d..0e2db45 100644
--- a/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java
+++ b/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java
@@ -162,4 +162,20 @@ public class TestAsyncRpc {
     assertTrue(future.getController().failed());
     assertTrue(future.getController().errorText() != null);
   }
+
+  @Test
+  public void testUnresolvedAddress() throws Exception {
+    String hostAndPort = NetUtils.normalizeInetSocketAddress(server.getListenAddress());
+    AsyncRpcClient client = new AsyncRpcClient(DummyProtocol.class, NetUtils.createUnresolved(hostAndPort));
+    Interface stub = client.getStub();
+    EchoMessage echoMessage = EchoMessage.newBuilder()
+        .setMessage(MESSAGE).build();
+    CallFuture<EchoMessage> future = new CallFuture<EchoMessage>();
+    stub.deley(null, echoMessage, future);
+
+    assertFalse(future.isDone());
+    assertEquals(future.get(), echoMessage);
+    assertTrue(future.isDone());
+    client.close();
+  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/8c2703c2/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java
----------------------------------------------------------------------
diff --git a/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java b/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java
index dedd96e..fe8685a 100644
--- a/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java
+++ b/tajo-rpc/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java
@@ -174,4 +174,17 @@ public class TestBlockingRpc {
       fail(error.toString());
     }
   }
+
+  @Test
+  public void testUnresolvedAddress() throws Exception {
+    String hostAndPort = NetUtils.normalizeInetSocketAddress(server.getListenAddress());
+    BlockingRpcClient client = new BlockingRpcClient(DummyProtocol.class, NetUtils.createUnresolved(hostAndPort));
+    BlockingInterface stub = client.getStub();
+
+    EchoMessage message = EchoMessage.newBuilder()
+        .setMessage(MESSAGE).build();
+    EchoMessage response2 = stub.echo(null, message);
+    assertEquals(MESSAGE, response2.getMessage());
+    client.close();
+  }
 }
\ No newline at end of file


Mime
View raw message