Mmuzaf commented on code in PR #3412:
URL: https://github.com/apache/cassandra/pull/3412#discussion_r1767011005
##########
src/java/org/apache/cassandra/db/compaction/CompactionManager.java:
##########
@@ -1219,45 +1267,57 @@ public void forceUserDefinedCleanup(String dataFiles)
ColumnFamilyStore cfs =
Keyspace.open(desc.ksname).getColumnFamilyStore(desc.cfname);
desc = cfs.getDirectories().find(new File(filename.trim()).name());
if (desc != null)
- descriptors.put(cfs, desc);
+ descriptors.computeIfAbsent(cfs, c -> new
ArrayList<>()).add(desc);
}
+ descriptors.keySet().forEach(cfs ->
info.markKeyspace(cfs.getKeyspaceName()));
if (!StorageService.instance.isJoined())
{
logger.error("Cleanup cannot run before a node has joined the
ring");
+ info.result = AllSSTableOpStatus.ABORTED;
return;
}
- for (Map.Entry<ColumnFamilyStore,Descriptor> entry :
descriptors.entrySet())
+ for (Map.Entry<ColumnFamilyStore, List<Descriptor>> entry :
descriptors.entrySet())
{
ColumnFamilyStore cfs = entry.getKey();
Keyspace keyspace = cfs.keyspace;
final RangesAtEndpoint replicas =
StorageService.instance.getLocalReplicas(keyspace.getName());
final Set<Range<Token>> allRanges = replicas.ranges();
final Set<Range<Token>> transientRanges =
replicas.onlyTransient().ranges();
boolean hasIndexes = cfs.indexManager.hasIndexes();
- SSTableReader sstable = lookupSSTable(cfs, entry.getValue());
+ List<SSTableReader> sstables = entry.getValue().stream().
Review Comment:
Fixed. However, I don't think this is a hot path :-)
--
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]