use of org.apache.cassandra.repair.consistent.admin.CleanupSummary in project cassandra by apache.
the class CompactionStrategyManager method releaseRepairData.
public CleanupSummary releaseRepairData(Collection<UUID> sessions) {
List<CleanupTask> cleanupTasks = new ArrayList<>();
readLock.lock();
try {
for (PendingRepairManager prm : Iterables.concat(pendingRepairs.getManagers(), transientRepairs.getManagers())) cleanupTasks.add(prm.releaseSessionData(sessions));
} finally {
readLock.unlock();
}
CleanupSummary summary = new CleanupSummary(cfs, Collections.emptySet(), Collections.emptySet());
for (CleanupTask task : cleanupTasks) summary = CleanupSummary.add(summary, task.cleanup());
return summary;
}
use of org.apache.cassandra.repair.consistent.admin.CleanupSummary in project cassandra by apache.
the class LocalSessions method cleanup.
public CleanupSummary cleanup(TableId tid, Collection<Range<Token>> ranges, boolean force) {
Iterable<LocalSession> candidates = Iterables.filter(sessions.values(), ls -> ls.isCompleted() && ls.tableIds.contains(tid) && Range.intersects(ls.ranges, ranges));
ColumnFamilyStore cfs = Schema.instance.getColumnFamilyStoreInstance(tid);
Set<UUID> sessionIds = Sets.newHashSet(Iterables.transform(candidates, s -> s.sessionID));
return cfs.releaseRepairData(sessionIds, force);
}
use of org.apache.cassandra.repair.consistent.admin.CleanupSummary in project cassandra by apache.
the class ActiveRepairService method cleanupPending.
@Override
public List<CompositeData> cleanupPending(List<String> schemaArgs, String rangeString, boolean force) {
List<CompositeData> stats = new ArrayList<>();
Collection<Range<Token>> userRanges = rangeString != null ? RepairOption.parseRanges(rangeString, DatabaseDescriptor.getPartitioner()) : null;
for (ColumnFamilyStore cfs : SchemaArgsParser.parse(schemaArgs)) {
String keyspace = cfs.keyspace.getName();
Collection<Range<Token>> ranges = userRanges != null ? userRanges : StorageService.instance.getLocalReplicas(keyspace).ranges();
CleanupSummary summary = consistent.local.cleanup(cfs.metadata().id, ranges, force);
stats.add(summary.toComposite());
}
return stats;
}
Aggregations