code: public static Cassandra.Client createAuthenticatedClient(String host, int port, Configuration conf) throws Exception
      {
          logger.debug("Creating authenticated client for CF output format");
          TTransport transport = ConfigHelper.getClientTransportFactory(conf).openTransport(host, port);
          TProtocol binaryProtocol = new TBinaryProtocol(transport, true, true);
          Cassandra.Client client = new Cassandra.Client(binaryProtocol);
          client.set_keyspace(ConfigHelper.getOutputKeyspace(conf));
          String user = ConfigHelper.getOutputKeyspaceUserName(conf);
          String password = ConfigHelper.getOutputKeyspacePassword(conf);
          if ((user != null) && (password != null))
              login(user, password, client);
  
          logger.debug("Authenticated client for CF output format created successfully");
          return client;
      }
docs: Connects to the given server:port and returns a client based on the given socket that points to the configured
  keyspace, and is logged in with the configured credentials.
  
  @param host fully qualified host name to connect to
  @param port RPC port of the server
  @param conf a job configuration
  @return a cassandra client
  @throws Exception set of thrown exceptions may be implementation defined,
  depending on the used transport factory