Permalink
Browse files

log cassandra node address on thrift exceptions

  • Loading branch information...
1 parent 2ad5070 commit 899267cac2408ca4ee27fa6e988a1cac2c581d34 @eevans eevans committed Dec 20, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/com/rackspace/flewton/backend/cassandra/UsageBackend.java
@@ -47,6 +47,7 @@
import org.apache.cassandra.thrift.UnavailableException;
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.apache.thrift.TException;
+import org.apache.thrift.transport.TSocket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -182,6 +183,8 @@ protected void write(Map<ByteBuffer, Map<String, List<Mutation>>> mutations)
try {
client.batch_mutate(mutations, ConsistencyLevel.ONE);
} catch (TException texcep) {
+ logger.warn("Exception encountered writing to {}",
+ ((TSocket)client.getInputProtocol().getTransport()).getSocket().getInetAddress().getHostAddress());
reuseClient = false;
invalidateClient(client);
throw texcep;

0 comments on commit 899267c

Please sign in to comment.