public class CassandraEmbeddedServerBuilder extends Object
CassandraEmbeddedServerBuilder
.withEntityPackages("test")
.withClusterName("Test Cluster")
.withDataFolder("/home/user/cassandra/data")
.withCommitLogFolder("/home/user/cassandra/commitlog")
.withSavedCachesFolder("/home/user/cassandra/saved_caches")
.cleanDataFilesAtStartup(true)
.withClusterName("Test Cluster")
.withKeyspaceName("achilles_test")
.withCQLPort(9042)
.withThriftPort(9160)
.withStoragePort(7990)
.withStorageSSLPort(7999)
.withDurableWrite(true)
.withScript("init_script.cql")
.withProtocolVersion(ProtocolVersion.V3)
.buildPersistenceManager();
| Modifier and Type | Method and Description |
|---|---|
com.datastax.driver.core.Cluster |
buildNativeClusterOnly()
Start an embedded Cassandra server but DO NOT bootstrap Achilles
|
com.datastax.driver.core.Session |
buildNativeSessionOnly()
Start an embedded Cassandra server but DO NOT bootstrap Achilles
|
PersistenceManager |
buildPersistenceManager()
Build CQL Persistence Manager
|
PersistenceManagerFactory |
buildPersistenceManagerFactory()
Build CQL Persistence Manager Factory
|
CassandraEmbeddedServerBuilder |
cleanDataFilesAtStartup(boolean cleanDataFilesAtStartup)
Whether to clean all data files in data folder, commit log folder and
saved caches folder at startup or not.
|
static CassandraEmbeddedServerBuilder |
noEntityPackages()
Bootstrap Achilles without entity packages.
|
CassandraEmbeddedServerBuilder |
withAchillesConfigParams(Map<ConfigurationParameters,Object> configParams)
Add Achilles configuration parameters
|
CassandraEmbeddedServerBuilder |
withClusterName(String clusterName)
Specify the cluster name for the embedded Cassandra server.
|
CassandraEmbeddedServerBuilder |
withCommitLogFolder(String commitLogFolder)
Specify commit log folder for the embedded Cassandra server.
|
CassandraEmbeddedServerBuilder |
withConcurrentReads(int concurrentReads)
Specify the number threads for concurrent reads for the embedded Cassandra
server.
|
CassandraEmbeddedServerBuilder |
withConcurrentWrites(int concurrentWrites)
Specify the number threads for concurrent writes for the embedded Cassandra
server.
|
CassandraEmbeddedServerBuilder |
withCQLPort(int clqPort)
Specify the native transport port (CQL port) for the embedded Cassandra
server.
|
CassandraEmbeddedServerBuilder |
withDataFolder(String dataFolder)
Specify data folder for the embedded Cassandra server.
|
CassandraEmbeddedServerBuilder |
withDurableWrite(boolean durableWrite)
Specify the 'durable write' property for the embedded Cassandra server.
|
static CassandraEmbeddedServerBuilder |
withEntities(Class<?>... entities)
Bootstrap Achilles with entities
|
static CassandraEmbeddedServerBuilder |
withEntities(List<Class<?>> entities)
Bootstrap Achilles with entities list
|
static CassandraEmbeddedServerBuilder |
withEntityPackages(String entityPackages)
Bootstrap Achilles with entity packages
|
CassandraEmbeddedServerBuilder |
withKeyspaceName(String keyspaceName)
Specify the keyspace name for the embedded Cassandra server.
|
CassandraEmbeddedServerBuilder |
withProtocolVersion(com.datastax.driver.core.ProtocolVersion protocolVersion) |
CassandraEmbeddedServerBuilder |
withSavedCachesFolder(String savedCachesFolder)
Specify saved caches folder for the embedded Cassandra server.
|
CassandraEmbeddedServerBuilder |
withScript(String scriptLocation)
Load an CQL script in the class path and execute it upon initialization
of the embedded Cassandra server
Call this method as many times as there are CQL scripts to be executed. |
CassandraEmbeddedServerBuilder |
withStoragePort(int storagePort)
Specify the storage port for the embedded Cassandra server.
|
CassandraEmbeddedServerBuilder |
withStorageSSLPort(int storageSSLPort)
Specify the storage SSL port for the embedded Cassandra server.
|
CassandraEmbeddedServerBuilder |
withThriftPort(int thriftPort)
Specify the rpc port (Thrift port) for the embedded Cassandra server.
|
public static CassandraEmbeddedServerBuilder withEntityPackages(String entityPackages)
entityPackages - entity packages to scan for @Entity annotationpublic static CassandraEmbeddedServerBuilder withEntities(List<Class<?>> entities)
entities - entities listpublic static CassandraEmbeddedServerBuilder withEntities(Class<?>... entities)
entities - entitiespublic static CassandraEmbeddedServerBuilder noEntityPackages()
public CassandraEmbeddedServerBuilder withDataFolder(String dataFolder)
dataFolder - data folder for the embedded Cassandra serverpublic CassandraEmbeddedServerBuilder withCommitLogFolder(String commitLogFolder)
commitLogFolder - commit log folder for the embedded Cassandra serverpublic CassandraEmbeddedServerBuilder withSavedCachesFolder(String savedCachesFolder)
savedCachesFolder - saved caches folder for the embedded Cassandra serverpublic CassandraEmbeddedServerBuilder cleanDataFilesAtStartup(boolean cleanDataFilesAtStartup)
cleanDataFilesAtStartup - whether to clean all data files at startup or notpublic CassandraEmbeddedServerBuilder withClusterName(String clusterName)
clusterName - cluster namepublic CassandraEmbeddedServerBuilder withKeyspaceName(String keyspaceName)
keyspaceName - keyspace namepublic CassandraEmbeddedServerBuilder withCQLPort(int clqPort)
clqPort - native transport portpublic CassandraEmbeddedServerBuilder withThriftPort(int thriftPort)
thriftPort - rpc portpublic CassandraEmbeddedServerBuilder withStoragePort(int storagePort)
storagePort - storage portpublic CassandraEmbeddedServerBuilder withStorageSSLPort(int storageSSLPort)
storageSSLPort - storage SSL portpublic CassandraEmbeddedServerBuilder withConcurrentReads(int concurrentReads)
concurrentReads - the number threads for concurrent readspublic CassandraEmbeddedServerBuilder withConcurrentWrites(int concurrentWrites)
concurrentWrites - the number threads for concurrent writespublic CassandraEmbeddedServerBuilder withDurableWrite(boolean durableWrite)
durableWrite - whether to activate 'durable write' or notpublic CassandraEmbeddedServerBuilder withAchillesConfigParams(Map<ConfigurationParameters,Object> configParams)
configParams - Achilles configuration parameterspublic CassandraEmbeddedServerBuilder withScript(String scriptLocation)
CassandraEmbeddedServerBuilder
.withScript("script1.cql")
.withScript("script2.cql")
...
scriptLocation - location of the CQL script in the class pathpublic CassandraEmbeddedServerBuilder withProtocolVersion(com.datastax.driver.core.ProtocolVersion protocolVersion)
public PersistenceManagerFactory buildPersistenceManagerFactory()
public PersistenceManager buildPersistenceManager()
public com.datastax.driver.core.Session buildNativeSessionOnly()
public com.datastax.driver.core.Cluster buildNativeClusterOnly()
Copyright © 2012-2016. All Rights Reserved.