HConnectionManager: Logging in after setting Keyspace

8 views
Skip to first unread message

sergey....@sperasoft.com

unread,
Mar 27, 2013, 1:00:43 PM3/27/13
to hecto...@googlegroups.com
Hello guys. Suddenly I've met a little problem with authentication.

There is the following code in HConnectionManager class (operateWithFailover() method): 

        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.setAuthenticated(op.credentials);
        }

So just created cassandra client is tried to bound with keyspace. And only after that the client is tried to log in. 
My problem is so that if there is authentication needed then exception is generated in client.getCassandra(op.keyspaceName). 

Is there any workaround for this situation?
Reply all
Reply to author
Forward
0 new messages