accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject accumulo git commit: ACCUMULO-3616 Use TTimeoutTransport instead of TSocket
Date Tue, 24 Feb 2015 01:07:08 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 92384163a -> ae7c2d257


ACCUMULO-3616 Use TTimeoutTransport instead of TSocket

TTimeoutTransport also sets some slightly larger buffers than TSocket.


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

Branch: refs/heads/master
Commit: ae7c2d25774045c04f8324b20ec85e7a07e83610
Parents: 9238416
Author: Josh Elser <elserj@apache.org>
Authored: Mon Feb 23 19:05:04 2015 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Mon Feb 23 19:05:04 2015 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/core/rpc/ThriftUtil.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ae7c2d25/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java
index 51dd5ba..f2e8612 100644
--- a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java
@@ -337,7 +337,13 @@ public class ThriftUtil {
 
         log.trace("Creating SASL connection to {}:{}", address.getHostText(), address.getPort());
 
-        transport = new TSocket(address.getHostText(), address.getPort());
+        // Make sure a timeout is set
+        try {
+          transport = TTimeoutTransport.create(address, timeout);
+        } catch (IOException e) {
+          log.warn("Failed to open transport to {}", address);
+          throw new TTransportException(e);
+        }
 
         try {
           // Log in via UGI, ensures we have logged in with our KRB credentials


Mime
View raw message