yifan-c commented on a change in pull request #1311:
URL: https://github.com/apache/cassandra/pull/1311#discussion_r759917353



##########
File path: src/java/org/apache/cassandra/db/commitlog/CommitLogDescriptor.java
##########
@@ -220,7 +223,20 @@ public String fileName()
 
     public String cdcIndexFileName()
     {
-        return FILENAME_PREFIX + version + SEPARATOR + id + "_cdc.idx";
+        return FILENAME_PREFIX + version + SEPARATOR + id + 
INDEX_FILENAME_SUFFIX;
+    }
+
+    /**
+     * Infer the corresponding cdc index file using its cdc commitlog file
+     * @param cdcFile
+     * @return cdc index file
+     */
+    public static File inferCdcIndexFile(File cdcFile)
+    {
+        Preconditions.checkArgument(isValid(cdcFile.name()), "Invalid commit 
log");

Review comment:
       The check should not throw for the current usage in the codebase. The 
parameter has already been verified at the caller. 
   Since the method is to infer, I think it would make sense to return `null` 
when failing to guess.




-- 
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]

Reply via email to