src/java/org/apache/cassandra/hadoop/ColumnFamilyOutputFormat.java
/**
     * Return a client based on the given socket that points to the configured
     * keyspace, and is logged in with the configured credentials.
     *
     * @param socket  a socket pointing to a particular node, seed or otherwise
     * @param conf a job configuration
     * @return a cassandra client
     * @throws InvalidRequestException
     * @throws TException
     * @throws AuthenticationException
     * @throws AuthorizationException
     */
Return a client based on the given socket that points to the configured
keyspace, and is logged in with the configured credentials.


Return a client based on the given socket that points to the configured keyspace and is logged in with the configured credentials .
public static Cassandra.Client createAuthenticatedClient(TSocket socket, Configuration conf)
    throws InvalidRequestException, TException, AuthenticationException, AuthorizationException
    {
        TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket));
        Cassandra.Client client = new Cassandra.Client(binaryProtocol);
        socket.open();
        client.set_keyspace(ConfigHelper.getOutputKeyspace(conf), LamportClock.COPS_UNSUPPORTED);
        if (ConfigHelper.getOutputKeyspaceUserName(conf) != null)
        {
            Map<String, String> creds = new HashMap<String, String>();
            creds.put(IAuthenticator.USERNAME_KEY, ConfigHelper.getOutputKeyspaceUserName(conf));
            creds.put(IAuthenticator.PASSWORD_KEY, ConfigHelper.getOutputKeyspacePassword(conf));
            AuthenticationRequest authRequest = new AuthenticationRequest(creds);
            client.login(authRequest, LamportClock.COPS_UNSUPPORTED);
        }
        return client;
    }
public static Cassandra . Client createAuthenticatedClient ( TSocket socket , Configuration conf ) throws InvalidRequestException , TException , AuthenticationException , AuthorizationException { TBinaryProtocol binaryProtocol = new TBinaryProtocol ( new TFramedTransport ( socket ) ) ; Cassandra . Client client = new Cassandra . Client ( binaryProtocol ) ; socket . open ( ) ; client . set_keyspace ( ConfigHelper . getOutputKeyspace ( conf ) , LamportClock . COPS_UNSUPPORTED ) ; if ( ConfigHelper . getOutputKeyspaceUserName ( conf ) != null ) { Map < String , String > creds = new HashMap < String , String > ( ) ; creds . put ( IAuthenticator . USERNAME_KEY , ConfigHelper . getOutputKeyspaceUserName ( conf ) ) ; creds . put ( IAuthenticator . PASSWORD_KEY , ConfigHelper . getOutputKeyspacePassword ( conf ) ) ; AuthenticationRequest authRequest = new AuthenticationRequest ( creds ) ; client . login ( authRequest , LamportClock . COPS_UNSUPPORTED ) ; } return client ; }
Return a client based on the given socket that points to the configured
 keyspace, and is logged in with the configured credentials.
Return a client based on the given socket that points to the configured keyspace and is logged in with the configured credentials .