public class DefaultClient extends Object implements SimpleClient, Closeable, Serializable
Cluster instance.| Constructor and Description |
|---|
DefaultClient(com.datastax.driver.core.Cluster cluster,
String keyspace)
Create a new
DefaultClient instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying
Cluster instance. |
com.datastax.driver.core.Session |
connect()
Creates a new session on this cluster.
|
Set<com.datastax.driver.core.Host> |
getAllHosts() |
com.datastax.driver.core.Metadata |
getMetadata() |
boolean |
isClose()
Checks whether the underlying cluster instance is closed.
|
protected boolean |
isDisconnected()
Checks whether the client is already connected to the cluster.
|
public DefaultClient(com.datastax.driver.core.Cluster cluster,
String keyspace)
DefaultClient instance.cluster - a cassandra cluster client.public Set<com.datastax.driver.core.Host> getAllHosts()
public com.datastax.driver.core.Metadata getMetadata()
public com.datastax.driver.core.Session connect()
throws com.datastax.driver.core.exceptions.NoHostAvailableException
connect in interface SimpleClientcom.datastax.driver.core.exceptions.NoHostAvailableException - if we cannot reach any cassandra contact points.protected boolean isDisconnected()
public void close()
Cluster instance.close in interface Closeableclose in interface AutoCloseableclose in interface SimpleClientpublic boolean isClose()
isClose in interface SimpleClientCopyright © 2023 The Apache Software Foundation. All rights reserved.