Package eu.europeana.cloud.test
Class CassandraTestInstance
java.lang.Object
eu.europeana.cloud.test.CassandraTestInstance
-
Method Summary
Modifier and TypeMethodDescriptionvoidclean()Clean embedded Casandra and throw out keyspaces.static CassandraTestInstancegetInstance(String keyspaceSchemaCql, String keyspace) Thread safe singleton of Cassandra test instance with initialized keyspace.static intgetPort()static com.datastax.driver.core.SessiongetSession(String keyspace) voidinitKeyspaceIfNeeded(String keyspaceSchemaCql, String keyspace) static voidprint()Print how many data is in each table.static voidtruncateAllData(boolean hard) Truncate all tables from all keyspaces.
-
Method Details
-
getPort
public static int getPort() -
getInstance
Thread safe singleton of Cassandra test instance with initialized keyspace.- Parameters:
keyspaceSchemaCql- cql file of keyspace definitionkeyspace- keyspace name- Returns:
- cassandra test instance
-
truncateAllData
public static void truncateAllData(boolean hard) Truncate all tables from all keyspaces.- Parameters:
hard- if is true then empty tables are truncated (this slow down process because it require disk flushes)
-
getSession
-
print
public static void print()Print how many data is in each table. -
initKeyspaceIfNeeded
-
clean
public void clean()Clean embedded Casandra and throw out keyspaces.
-