jyothsnakonisa commented on code in PR #179:
URL:
https://github.com/apache/cassandra-analytics/pull/179#discussion_r2920832532
##########
cassandra-analytics-cdc/src/test/java/org/apache/cassandra/cdc/LocalCommitLog.java:
##########
@@ -67,7 +70,21 @@ public long length()
public boolean completed()
{
// for CDC Cassandra writes COMPLETED in the final line of the
CommitLog-7-*_cdc.idx index file.
- return maxOffset() >= 67108818;
+ List<String> lines = readIdxFile();
+ return lines.size() >= 2 &&
lines.get(1).trim().equalsIgnoreCase("COMPLETED");
+ }
+
+ private List<String> readIdxFile()
+ {
+ Path idxPath = path.resolveSibling(name.replace(".log", "_cdc.idx"));
Review Comment:
Yes the CommitLog.java file is the class that provides that interface and it
has documentation around index file, completed state and offset. But you are
right, the naming of the class could have been better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]