From 800cc65c0c02e4b4e2eca77421e2d994b2dfc150 Mon Sep 17 00:00:00 2001 From: Jarek Bojar Date: Wed, 17 Apr 2013 13:53:59 +0200 Subject: [PATCH] Patch for issue #584: operateWithFailover fails against c* 1.2.1 when authentication is enabled --- .../prettyprint/cassandra/connection/HConnectionManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java b/core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java index fc4241639..b8574eb7f 100644 --- a/core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java +++ b/core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java @@ -248,12 +248,12 @@ public void operateWithFailover(Operation op) throws HectorException { // TODO how to 'timeout' on this op when underlying pool is exhausted pool = getClientFromLBPolicy(excludeHosts); client = pool.borrowClient(); - Cassandra.Client c = client.getCassandra(op.keyspaceName); // Keyspace can be null for some system_* api calls if ( op.credentials != null && !op.credentials.isEmpty() && !client.isAlreadyAuthenticated(op.credentials)) { - c.login(new AuthenticationRequest(op.credentials)); + client.getCassandra().login(new AuthenticationRequest(op.credentials)); client.setAuthenticated(op.credentials); } + Cassandra.Client c = client.getCassandra(op.keyspaceName); op.executeAndSetResult(c, pool.getCassandraHost()); success = true;