use of org.apache.cassandra.db.compaction.CompactionInfo.Holder in project cassandra by apache.
the class CompactionManager method forceShutdown.
/**
* Shutdowns both compaction and validation executors, cancels running compaction / validation,
* and waits for tasks to complete if tasks were not cancelable.
*/
public void forceShutdown() {
// shutdown executors to prevent further submission
executor.shutdown();
validationExecutor.shutdown();
// interrupt compactions and validations
for (Holder compactionHolder : CompactionMetrics.getCompactions()) {
compactionHolder.stop();
}
// until not interrupted tasks to complete.
for (ExecutorService exec : Arrays.asList(executor, validationExecutor)) {
try {
if (!exec.awaitTermination(1, TimeUnit.MINUTES))
logger.warn("Failed to wait for compaction executors shutdown");
} catch (InterruptedException e) {
logger.error("Interrupted while waiting for tasks to be terminated", e);
}
}
}
use of org.apache.cassandra.db.compaction.CompactionInfo.Holder in project cassandra by apache.
the class CompactionManager method getCompactions.
public List<Map<String, String>> getCompactions() {
List<Holder> compactionHolders = CompactionMetrics.getCompactions();
List<Map<String, String>> out = new ArrayList<Map<String, String>>(compactionHolders.size());
for (CompactionInfo.Holder ci : compactionHolders) out.add(ci.getCompactionInfo().asMap());
return out;
}
use of org.apache.cassandra.db.compaction.CompactionInfo.Holder in project cassandra by apache.
the class CompactionManager method getCompactionSummary.
public List<String> getCompactionSummary() {
List<Holder> compactionHolders = CompactionMetrics.getCompactions();
List<String> out = new ArrayList<String>(compactionHolders.size());
for (CompactionInfo.Holder ci : compactionHolders) out.add(ci.getCompactionInfo().toString());
return out;
}
Aggregations