@VisibleForTesting public void removeUnsafe(Set<SSTableReader> toRemove) { Pair<View, View> result = apply(view -> { return updateLiveSet(toRemove, emptySet()).apply(view); }); } }
@VisibleForTesting public void removeUnsafe(Set<SSTableReader> toRemove) { Pair<View, View> result = apply(view -> { return updateLiveSet(toRemove, emptySet()).apply(view); }); } }
@VisibleForTesting public void removeUnsafe(Set<SSTableReader> toRemove) { Pair<View, View> result = apply(view -> { return updateLiveSet(toRemove, emptySet()).apply(view); }); } }
/** * @return a Transaction over the provided sstables if we are able to mark the given @param sstables as compacted, before anyone else */ public LifecycleTransaction tryModify(Iterable<SSTableReader> sstables, OperationType operationType) { if (Iterables.isEmpty(sstables)) return new LifecycleTransaction(this, operationType, sstables); if (null == apply(permitCompacting(sstables), updateCompacting(emptySet(), sstables))) return null; return new LifecycleTransaction(this, operationType, sstables); }
/** * @return a Transaction over the provided sstables if we are able to mark the given @param sstables as compacted, before anyone else */ public LifecycleTransaction tryModify(Iterable<SSTableReader> sstables, OperationType operationType) { if (Iterables.isEmpty(sstables)) return new LifecycleTransaction(this, operationType, sstables); if (null == apply(permitCompacting(sstables), updateCompacting(emptySet(), sstables))) return null; return new LifecycleTransaction(this, operationType, sstables); }
/** * @return a Transaction over the provided sstables if we are able to mark the given @param sstables as compacted, before anyone else */ public LifecycleTransaction tryModify(Iterable<SSTableReader> sstables, OperationType operationType) { if (Iterables.isEmpty(sstables)) return new LifecycleTransaction(this, operationType, sstables); if (null == apply(permitCompacting(sstables), updateCompacting(emptySet(), sstables))) return null; return new LifecycleTransaction(this, operationType, sstables); }
/** * @return a Transaction over the provided sstables if we are able to mark the given @param sstables as compacted, before anyone else */ public LifecycleTransaction tryModify(Iterable<SSTableReader> sstables, OperationType operationType) { if (Iterables.isEmpty(sstables)) return new LifecycleTransaction(this, operationType, sstables); if (null == apply(permitCompacting(sstables), updateCompacting(emptySet(), sstables))) return null; return new LifecycleTransaction(this, operationType, sstables); }
public void replaceFlushed(Memtable memtable, Iterable<SSTableReader> sstables) { assert !isDummy(); if (Iterables.isEmpty(sstables)) { // sstable may be null if we flushed batchlog and nothing needed to be retained // if it's null, we don't care what state the cfstore is in, we just replace it and continue apply(View.replaceFlushed(memtable, null)); return; } sstables.forEach(SSTableReader::setupOnline); // back up before creating a new Snapshot (which makes the new one eligible for compaction) maybeIncrementallyBackup(sstables); apply(View.replaceFlushed(memtable, sstables)); Throwable fail; fail = updateSizeTracking(emptySet(), sstables, null); notifyDiscarded(memtable); // TODO: if we're invalidated, should we notifyadded AND removed, or just skip both? fail = notifyAdded(sstables, memtable, fail); if (!isDummy() && !cfstore.isValid()) dropSSTables(); maybeFail(fail); }
public void replaceFlushed(Memtable memtable, Iterable<SSTableReader> sstables) { assert !isDummy(); if (Iterables.isEmpty(sstables)) { // sstable may be null if we flushed batchlog and nothing needed to be retained // if it's null, we don't care what state the cfstore is in, we just replace it and continue apply(View.replaceFlushed(memtable, null)); return; } sstables.forEach(SSTableReader::setupOnline); // back up before creating a new Snapshot (which makes the new one eligible for compaction) maybeIncrementallyBackup(sstables); apply(View.replaceFlushed(memtable, sstables)); Throwable fail; fail = updateSizeTracking(emptySet(), sstables, null); notifyDiscarded(memtable); // TODO: if we're invalidated, should we notifyadded AND removed, or just skip both? fail = notifyAdded(sstables, fail); if (!isDummy() && !cfstore.isValid()) dropSSTables(); maybeFail(fail); }
public void replaceFlushed(Memtable memtable, Iterable<SSTableReader> sstables) { assert !isDummy(); if (Iterables.isEmpty(sstables)) { // sstable may be null if we flushed batchlog and nothing needed to be retained // if it's null, we don't care what state the cfstore is in, we just replace it and continue apply(View.replaceFlushed(memtable, null)); return; } sstables.forEach(SSTableReader::setupOnline); // back up before creating a new Snapshot (which makes the new one eligible for compaction) maybeIncrementallyBackup(sstables); apply(View.replaceFlushed(memtable, sstables)); Throwable fail; fail = updateSizeTracking(emptySet(), sstables, null); notifyDiscarded(memtable); // TODO: if we're invalidated, should we notifyadded AND removed, or just skip both? fail = notifyAdded(sstables, fail); if (!isDummy() && !cfstore.isValid()) dropSSTables(); maybeFail(fail); }