Search in sources :

Example 1 with WorkingDirectoryInitializer

use of com.github.nosan.embedded.cassandra.WorkingDirectoryInitializer in project embedded-cassandra by nosan.

the class CassandraExamples method workingDirectoryInitializer.

// end::start-shared-cassandra[]
private void workingDirectoryInitializer() {
    // tag::working-directory-initializer[]
    new CassandraBuilder().workingDirectoryInitializer(new WorkingDirectoryInitializer() {

        @Override
        public void init(Path workingDirectory, Version version) throws IOException {
        // Custom logic
        }
    }).build();
    // end::working-directory-initializer[]
    // tag::working-directory-initializer-skip-existing[]
    new CassandraBuilder().workingDirectoryInitializer(new DefaultWorkingDirectoryInitializer(new WebCassandraDirectoryProvider(), DefaultWorkingDirectoryInitializer.CopyStrategy.SKIP_EXISTING)).build();
// end::working-directory-initializer-skip-existing[]
}
Also used : Path(java.nio.file.Path) WebCassandraDirectoryProvider(com.github.nosan.embedded.cassandra.WebCassandraDirectoryProvider) Version(com.github.nosan.embedded.cassandra.Version) CassandraBuilder(com.github.nosan.embedded.cassandra.CassandraBuilder) DefaultWorkingDirectoryInitializer(com.github.nosan.embedded.cassandra.DefaultWorkingDirectoryInitializer) WorkingDirectoryInitializer(com.github.nosan.embedded.cassandra.WorkingDirectoryInitializer) DefaultWorkingDirectoryInitializer(com.github.nosan.embedded.cassandra.DefaultWorkingDirectoryInitializer)

Aggregations

CassandraBuilder (com.github.nosan.embedded.cassandra.CassandraBuilder)1 DefaultWorkingDirectoryInitializer (com.github.nosan.embedded.cassandra.DefaultWorkingDirectoryInitializer)1 Version (com.github.nosan.embedded.cassandra.Version)1 WebCassandraDirectoryProvider (com.github.nosan.embedded.cassandra.WebCassandraDirectoryProvider)1 WorkingDirectoryInitializer (com.github.nosan.embedded.cassandra.WorkingDirectoryInitializer)1 Path (java.nio.file.Path)1