You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2013/11/05 20:43:46 UTC

[3/6] git commit: show the host and port when failing to connect

show the host and port when failing to connect


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

Branch: refs/heads/trunk
Commit: cd7b05ffb6d2859eb4fbb9567d1fe38af3f39d27
Parents: 3d58c5a
Author: Brandon Williams <br...@apache.org>
Authored: Tue Nov 5 13:40:50 2013 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Tue Nov 5 13:40:50 2013 -0600

----------------------------------------------------------------------
 .../cassandra/hadoop/AbstractColumnFamilyInputFormat.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cd7b05ff/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java b/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java
index 16d03f9..8fd66ab 100644
--- a/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java
+++ b/src/java/org/apache/cassandra/hadoop/AbstractColumnFamilyInputFormat.java
@@ -55,6 +55,7 @@ import org.apache.thrift.TException;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -92,7 +93,12 @@ public abstract class AbstractColumnFamilyInputFormat<K, Y> extends InputFormat<
     public static Cassandra.Client createAuthenticatedClient(String location, int port, Configuration conf) throws Exception
     {
         logger.debug("Creating authenticated client for CF input format");
-        TTransport transport = ConfigHelper.getClientTransportFactory(conf).openTransport(location, port, conf);
+        TTransport transport;
+        try {
+            transport = ConfigHelper.getClientTransportFactory(conf).openTransport(location, port, conf);
+        } catch (Exception e) {
+            throw new TTransportException("Failed to open a transport to " + location + ":" + port + ".", e);
+        }
         TProtocol binaryProtocol = new TBinaryProtocol(transport, true, true);
         Cassandra.Client client = new Cassandra.Client(binaryProtocol);