public Void call() { cfs.data.reset(new Memtable(new AtomicReference<>(CommitLogPosition.NONE), cfs)); return null; } }, true, false);
public Void call() { cfs.data.reset(new Memtable(new AtomicReference<>(CommitLogPosition.NONE), cfs)); return null; } }, true, false);
public Void call() { cfs.data.reset(new Memtable(new AtomicReference<>(CommitLogPosition.NONE), cfs)); return null; } }, true, false);
/** (Re)initializes the tracker, purging all references. */ void init() { view.set(new View( ImmutableList.of(new Memtable(cfstore)), ImmutableList.<Memtable>of(), Collections.<SSTableReader, SSTableReader>emptyMap(), Collections.<SSTableReader>emptySet(), Collections.<SSTableReader>emptySet(), SSTableIntervalTree.empty())); }
/** * For testing. No effort is made to clear historical or even the current memtables, nor for * thread safety. All we do is wipe the sstable containers clean, while leaving the actual * data files present on disk. (This allows tests to easily call loadNewSSTables on them.) */ @VisibleForTesting public void clearUnsafe() { for (final ColumnFamilyStore cfs : concatWithIndexes()) { cfs.runWithCompactionsDisabled(new Callable<Void>() { public Void call() { cfs.data.reset(new Memtable(new AtomicReference<>(CommitLogPosition.NONE), cfs)); return null; } }, true, false); } }
/** * For testing. No effort is made to clear historical or even the current memtables, nor for * thread safety. All we do is wipe the sstable containers clean, while leaving the actual * data files present on disk. (This allows tests to easily call loadNewSSTables on them.) */ @VisibleForTesting public void clearUnsafe() { for (final ColumnFamilyStore cfs : concatWithIndexes()) { cfs.runWithCompactionsDisabled(new Callable<Void>() { public Void call() { cfs.data.reset(new Memtable(new AtomicReference<>(CommitLogPosition.NONE), cfs)); return null; } }, true, false); } }
/** * For testing. No effort is made to clear historical or even the current memtables, nor for * thread safety. All we do is wipe the sstable containers clean, while leaving the actual * data files present on disk. (This allows tests to easily call loadNewSSTables on them.) */ @VisibleForTesting public void clearUnsafe() { for (final ColumnFamilyStore cfs : concatWithIndexes()) { cfs.runWithCompactionsDisabled(new Callable<Void>() { public Void call() { cfs.data.reset(new Memtable(new AtomicReference<>(CommitLogPosition.NONE), cfs)); return null; } }, true, false); } }
/** * Switch the current memtable. This atomically appends a new memtable to the end of the list of active memtables, * returning the previously last memtable. It leaves the previous Memtable in the list of live memtables until * discarding(memtable) is called. These two methods must be synchronized/paired, i.e. m = switchMemtable * must be followed by discarding(m), they cannot be interleaved. * * @return the previously active memtable */ public Memtable switchMemtable(boolean truncating) { Memtable newMemtable = new Memtable(cfstore); Memtable toFlushMemtable; View currentView, newView; do { currentView = view.get(); toFlushMemtable = currentView.getCurrentMemtable(); newView = currentView.switchMemtable(newMemtable); } while (!view.compareAndSet(currentView, newView)); if (truncating) notifyRenewed(newMemtable); return toFlushMemtable; }
Memtable newMemtable = new Memtable(commitLogUpperBound, cfs); Memtable oldMemtable = cfs.data.switchMemtable(truncate, newMemtable); oldMemtable.setDiscarding(writeBarrier, commitLogUpperBound);
Memtable newMemtable = new Memtable(commitLogUpperBound, cfs); Memtable oldMemtable = cfs.data.switchMemtable(truncate, newMemtable); oldMemtable.setDiscarding(writeBarrier, commitLogUpperBound);
Memtable newMemtable = new Memtable(commitLogUpperBound, cfs); Memtable oldMemtable = cfs.data.switchMemtable(truncate, newMemtable); oldMemtable.setDiscarding(writeBarrier, commitLogUpperBound);
initialMemtable = new Memtable(new AtomicReference<>(CommitLog.instance.getCurrentPosition()), this); data = new Tracker(initialMemtable, loadSSTables);
initialMemtable = new Memtable(new AtomicReference<>(CommitLog.instance.getCurrentPosition()), this); data = new Tracker(initialMemtable, loadSSTables);
initialMemtable = new Memtable(new AtomicReference<>(CommitLog.instance.getCurrentPosition()), this); data = new Tracker(initialMemtable, loadSSTables);