Package com.github.nosan.embedded.cassandra
Embedded Cassandra provides an easy way to start and stop Apache Cassandra.
Public API contains the following classes and interfaces:
Cassandra Interface that represents Cassandra instance.
Cassandra instance.
Interface that loads CQL statements from various
sources.
A strategy interface to initialize working directory.
A strategy interface to destroy the working directory.
A customizer interface that can be used to customize the working directory.
A callback interface to configure a CassandraBuilder.
Example:
Cassandra cassandra = new CassandraBuilder().build();
cassandra.start();
try {
Settings settings = cassandra.getSettings();
try (Cluster cluster = Cluster.builder().addContactPoints(settings.getAddress())
.withPort(settings.getPort()).build()) {
Session session = cluster.connect();
CqlScript.ofClassPath("schema.cql").forEachStatement(session::execute);
}
}
finally {
cassandra.stop();
}
-
Interface Summary Interface Description Cassandra CassandraBuilderConfigurator A callback interface to configure aCassandraBuilder.CassandraDirectoryProvider Provides a path to Cassandra directory based on a version.Settings Cassandra settings.WorkingDirectoryCustomizer A callback interface to customize a working directory.WorkingDirectoryDestroyer A strategy interface to destroy the working directory.WorkingDirectoryInitializer A strategy interface to initialize the working directory. -
Class Summary Class Description CassandraBuilder A builder that can be used to configure and createCassandra.DefaultWorkingDirectoryInitializer The default implementation ofWorkingDirectoryInitializer, that gets Cassandra directory from theCassandraDirectoryProviderand copies all files from a retrieved directory into the working directory except javadoc, doc and licenses directories.SimpleSeedProviderConfigurator ACassandraBuilderConfiguratorthat configures org.apache.cassandra.locator.SimpleSeedProvider.Version A representation of a Cassandra version.WebCassandraDirectoryProvider The implementation ofCassandraDirectoryProvider, that downloads and extracts Cassandra archive from the well-known URLs into the download directory. -
Enum Summary Enum Description DefaultWorkingDirectoryInitializer.CopyStrategy Casandra files copy strategies. -
Exception Summary Exception Description CassandraException Exceptions thrown by aCassandra.