|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Cluster.Initializer
Initializer for Cluster
instances.
If you want to create a new Cluster
instance programmatically,
then it is advised to use Cluster.Builder
which can be obtained from the
Cluster.builder()
method.
But it is also possible to implement a custom Initializer
that
retrieves initialization from a web-service or from a configuration file.
Method Summary | |
---|---|
String |
getClusterName()
An optional name for the created cluster. |
Configuration |
getConfiguration()
The configuration to use for the new cluster. |
List<InetAddress> |
getContactPoints()
Returns the initial Cassandra hosts to connect to. |
Collection<Host.StateListener> |
getInitialListeners()
Optional listeners to register against the newly created cluster. |
Method Detail |
---|
String getClusterName()
Such name is optional (a default name will be created otherwise) and is currently
only use for JMX reporting of metrics. See Cluster.getClusterName()
for more
information.
null
to use an automatically
generated name.List<InetAddress> getContactPoints()
Cluster.Builder.addContactPoint(java.lang.String)
for more details on contact points.Configuration getConfiguration()
Note that some configuration can be modified after the cluster initialization but some others cannot. In particular, the ones that cannot be changed afterwards includes:
ProtocolOptions
).Policies
).Configuration
).Configuration
).
Collection<Host.StateListener> getInitialListeners()
Note that contrarly to listeners registered post Cluster creation,
the listeners returned by this method will see Host.StateListener.onAdd(com.datastax.driver.core.Host)
events for the initial contact points.
Host.StateListener
to register
against the newly created cluster.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |