use of com.github.nosan.embedded.cassandra.Settings in project embedded-cassandra by nosan.
the class CassandraExamples method quickStart.
private void quickStart() {
// tag::quick-start[]
Cassandra cassandra = new CassandraBuilder().build();
cassandra.start();
try {
Settings settings = cassandra.getSettings();
try (CqlSession session = CqlSession.builder().addContactPoint(new InetSocketAddress(settings.getAddress(), settings.getPort())).withLocalDatacenter("datacenter1").build()) {
CqlScript.ofClassPath("schema.cql").forEachStatement(session::execute);
}
} finally {
cassandra.stop();
}
// end::quick-start[]
}
Aggregations