Package io.debezium.connector.cassandra
Class CommitLogUtil
java.lang.Object
io.debezium.connector.cassandra.CommitLogUtil
Utility class used by the CommitLogProcessor to compare/delete commit log files.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompareCommitLogs(File file1, File file2) Comparing two commit log files provided theFileinstances; Returns 0 if they are the same, -1 if first file is older, 1 if first file is newer.static intcompareCommitLogs(String file1, String file2) static intcompareCommitLogsIndexes(File file1, File file2) Comparing two commit log files provided theFileinstances; Returns 0 if they are the same, -1 if first file is older, 1 if first file is newer.static voiddeleteCommitLog(File file) Delete a commit log and logs the error in the case the deletion failed.private static longextractTimestamp(String commitLogFileName, Pattern pattern) static File[]getCommitLogs(File directory) Given a directory, return an array of commit logs in this directory.static File[]getIndexes(File directory) Given a directory, return an array of commit logs' marker files in this directory.static voidmoveCommitLog(Path file, Path toDir) Move a commit log to a new directory.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
FILENAME_REGEX_PATTERN
-
FILENAME_INDEX_REGEX_PATTERN
-
-
Constructor Details
-
CommitLogUtil
private CommitLogUtil()
-
-
Method Details
-
moveCommitLog
Move a commit log to a new directory. If the commit log already exists in the new directory, it would be replaced.- Throws:
RuntimeException- exception in case moving failed
-
deleteCommitLog
Delete a commit log and logs the error in the case the deletion failed. -
getCommitLogs
Given a directory, return an array of commit logs in this directory. If the directory does not contain any commit logs, an empty array is returned. -
getIndexes
Given a directory, return an array of commit logs' marker files in this directory. If the directory does not contain any commit logs, an empty array is returned. -
compareCommitLogs
Comparing two commit log files provided theFileinstances; Returns 0 if they are the same, -1 if first file is older, 1 if first file is newer. -
compareCommitLogs
-
compareCommitLogsIndexes
Comparing two commit log files provided theFileinstances; Returns 0 if they are the same, -1 if first file is older, 1 if first file is newer. -
extractTimestamp
-