List<Future<?>> futures = new ArrayList<>();
for (Map.Entry<UUID, ColumnFamilyStore> columnFamilyStoreEntry : prs.columnFamilyStores.entrySet())
{
Collection<SSTableReader> sstables = new HashSet<>(prs.getAndReferenceSSTables(columnFamilyStoreEntry.getKey()));
ColumnFamilyStore cfs = columnFamilyStoreEntry.getValue();
boolean success = false;
while (!success)
{
for (SSTableReader compactingSSTable : cfs.getDataTracker().getCompacting())
{
if (sstables.remove(compactingSSTable))
SSTableReader.releaseReferences(Arrays.asList(compactingSSTable));
}
success = sstables.isEmpty() || cfs.getDataTracker().markCompacting(sstables);
}
futures.add(CompactionManager.instance.submitAntiCompaction(cfs, prs.ranges, sstables, prs.repairedAt));
}