smiklosovic commented on code in PR #3374:
URL: https://github.com/apache/cassandra/pull/3374#discussion_r1760761030
##########
src/java/org/apache/cassandra/db/ColumnFamilyStore.java:
##########
@@ -2368,19 +2224,63 @@ public boolean snapshotExists(String snapshotName)
*/
public void clearSnapshot(String snapshotName)
{
- RateLimiter clearSnapshotRateLimiter =
DatabaseDescriptor.getSnapshotRateLimiter();
-
- List<File> snapshotDirs = getDirectories().getCFDirectories();
- Directories.clearSnapshot(snapshotName, snapshotDirs,
clearSnapshotRateLimiter);
+ SnapshotManager.instance.clearSnapshot(keyspace.getName(),
getTableName(), snapshotName);
}
+
/**
*
* @return Return a map of all snapshots to space being used
* The pair for a snapshot has true size and size on disk.
*/
public Map<String, TableSnapshot> listSnapshots()
{
- return getDirectories().listSnapshots();
+ Set<TableSnapshot> snapshots = new
SnapshotLoader(getDirectories()).loadSnapshots();
+ Map<String, TableSnapshot> tagSnapshotsMap = new HashMap<>();
+
+ for (TableSnapshot snapshot : snapshots)
+ tagSnapshotsMap.put(snapshot.getTag(), snapshot);
+
+ return tagSnapshotsMap;
+ }
+
+ public Refs<SSTableReader> getSnapshotSSTableReaders(String tag) throws
IOException
Review Comment:
I think this is just shuffling stuff around but if you insist ... putting
that to TableSnapshot would need to be a static method.
--
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]