Package io.debezium.connector.cassandra
Class TestUtils
- java.lang.Object
-
- io.debezium.connector.cassandra.TestUtils
-
public class TestUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringTEST_CASSANDRA_HOSTSstatic intTEST_CASSANDRA_PORTstatic StringTEST_CASSANDRA_YAML_CONFIGstatic StringTEST_CONNECTOR_NAMEstatic StringTEST_KAFKA_SERVERSstatic StringTEST_KAFKA_TOPIC_PREFIXstatic StringTEST_KEYSPACE_NAMEstatic StringTEST_SCHEMA_REGISTRY_URL
-
Constructor Summary
Constructors Constructor Description TestUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearCommitLogFromDirectory(File directory, boolean recursive)Delete all commit log files in directorystatic voidcreateTestKeyspace()static voiddeleteTestKeyspaceTables()static voiddeleteTestOffsets(io.debezium.connector.cassandra.CassandraConnectorContext context)Delete all files in offset backing store directorystatic FilegenerateCommitLogFile()Generate a commit log file with current timestamp in memoryprotected static PropertiesgenerateDefaultConfigMap()static List<String>getTables(com.datastax.oss.driver.api.core.CqlSession session)static StringkeyspaceTable(String tableName)Return the full name of the test table in the form of. static voidpopulateFakeCommitLogsForDirectory(int numOfFiles, File directory)Generate commit log files in directoryprotected static HashMap<String,Object>propertiesForContext()static voidrunCql(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)static voidrunCql(String statement)static voidtruncateTestKeyspaceTableData()
-
-
-
Field Detail
-
TEST_CONNECTOR_NAME
public static final String TEST_CONNECTOR_NAME
- See Also:
- Constant Field Values
-
TEST_CASSANDRA_YAML_CONFIG
public static final String TEST_CASSANDRA_YAML_CONFIG
- See Also:
- Constant Field Values
-
TEST_CASSANDRA_HOSTS
public static final String TEST_CASSANDRA_HOSTS
- See Also:
- Constant Field Values
-
TEST_CASSANDRA_PORT
public static final int TEST_CASSANDRA_PORT
- See Also:
- Constant Field Values
-
TEST_KAFKA_SERVERS
public static final String TEST_KAFKA_SERVERS
- See Also:
- Constant Field Values
-
TEST_SCHEMA_REGISTRY_URL
public static final String TEST_SCHEMA_REGISTRY_URL
- See Also:
- Constant Field Values
-
TEST_KAFKA_TOPIC_PREFIX
public static final String TEST_KAFKA_TOPIC_PREFIX
- See Also:
- Constant Field Values
-
TEST_KEYSPACE_NAME
public static final String TEST_KEYSPACE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateDefaultConfigMap
protected static Properties generateDefaultConfigMap() throws IOException
- Throws:
IOException
-
propertiesForContext
protected static HashMap<String,Object> propertiesForContext() throws IOException
- Throws:
IOException
-
createTestKeyspace
public static void createTestKeyspace()
-
getTables
public static List<String> getTables(com.datastax.oss.driver.api.core.CqlSession session)
-
truncateTestKeyspaceTableData
public static void truncateTestKeyspaceTableData()
-
deleteTestKeyspaceTables
public static void deleteTestKeyspaceTables()
-
runCql
public static void runCql(String statement)
-
runCql
public static void runCql(com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
-
deleteTestOffsets
public static void deleteTestOffsets(io.debezium.connector.cassandra.CassandraConnectorContext context) throws IOExceptionDelete all files in offset backing store directory- Throws:
IOException
-
keyspaceTable
public static String keyspaceTable(String tableName)
Return the full name of the test table in the form of. -
generateCommitLogFile
public static File generateCommitLogFile()
Generate a commit log file with current timestamp in memory
-
populateFakeCommitLogsForDirectory
public static void populateFakeCommitLogsForDirectory(int numOfFiles, File directory) throws IOExceptionGenerate commit log files in directory- Throws:
IOException
-
clearCommitLogFromDirectory
public static void clearCommitLogFromDirectory(File directory, boolean recursive) throws IOException
Delete all commit log files in directory- Throws:
IOException
-
-
-