blambov commented on code in PR #3164:
URL: https://github.com/apache/cassandra/pull/3164#discussion_r1517505083
##########
src/java/org/apache/cassandra/db/Directories.java:
##########
@@ -635,14 +636,25 @@ public static File getSnapshotDirectory(Descriptor desc,
String snapshotName)
* @return directory to write snapshot
*/
public static File getSnapshotDirectory(File location, String snapshotName)
+ {
+ return getSnapshotDirectory(location, snapshotName, true).get();
+ }
+
+ private static Optional<File> getSnapshotDirectory(File location, String
snapshotName, boolean create)
Review Comment:
Using an extra boolean parameter looks a bit forced and would be very easy
to miss. How about leaving the existing methods as they were and adding a new
method for the uses where the `create` flag would not be set? Called e.g.
`getXXXDirectoryIfPresent`? Actually, renaming the existing methods to
`getOrCreate...` would be even better, but I don't know how much change that
would entail.
--
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]