/** * Obtain a Cassandra cluster instance using {@link #defaultHostsAndPorts}, * {@link #defaultUsername} and {@link #defaultPassword}. * * @return * @since 0.4.0 */ public Cluster getCluster() { return getCluster(defaultHostsAndPorts, defaultPassword, defaultPassword); }
/** * Obtain a DSE cluster instance. * * @param key * @return */ @Override synchronized protected DseCluster getCluster(ClusterIdentifier key) { return (DseCluster) super.getCluster(key); }
/** * Obtain a Cassandra cluster instance. * * @param hostsAndPorts * format: "host1:port1,host2,host3:port3". If no port is * specified, the {@link CqlUtils#DEFAULT_CASSANDRA_PORT} is used. * @param username * @param password * @return */ public Cluster getCluster(String hostsAndPorts, String username, String password) { return getCluster(ClusterIdentifier.getInstance(hostsAndPorts, username, password)); }
Cluster cluster = getCluster(si); if (cluster == null) { return null;