/** * mark this reader as for obsoletion : on checkpoint() the reader will be removed from the live set */ public void obsolete(SSTableReader reader) { logger.trace("Staging for obsolescence {}", reader); // check this is: a reader guarded by the transaction, an instance we have already worked with // and that we haven't already obsoleted it, nor do we have other changes staged for it assert identities.contains(reader.instanceId) : "only reader instances that have previously been provided may be obsoleted: " + reader; assert originals.contains(reader) : "only readers in the 'original' set may be obsoleted: " + reader + " vs " + originals; assert !(logged.obsolete.contains(reader) || staged.obsolete.contains(reader)) : "may not obsolete a reader that has already been obsoleted: " + reader; assert !staged.update.contains(reader) : "may not obsolete a reader that has a staged update (must checkpoint first): " + reader; assert current(reader) == reader : "may only obsolete the latest version of the reader: " + reader; staged.obsolete.add(reader); }
/** * mark this reader as for obsoletion : on checkpoint() the reader will be removed from the live set */ public void obsolete(SSTableReader reader) { logger.trace("Staging for obsolescence {}", reader); // check this is: a reader guarded by the transaction, an instance we have already worked with // and that we haven't already obsoleted it, nor do we have other changes staged for it assert identities.contains(reader.instanceId) : "only reader instances that have previously been provided may be obsoleted: " + reader; assert originals.contains(reader) : "only readers in the 'original' set may be obsoleted: " + reader + " vs " + originals; assert !(logged.obsolete.contains(reader) || staged.obsolete.contains(reader)) : "may not obsolete a reader that has already been obsoleted: " + reader; assert !staged.update.contains(reader) : "may not obsolete a reader that has a staged update (must checkpoint first): " + reader; assert current(reader) == reader : "may only obsolete the latest version of the reader: " + reader; staged.obsolete.add(reader); }
/** * mark this reader as for obsoletion : on checkpoint() the reader will be removed from the live set */ public void obsolete(SSTableReader reader) { logger.trace("Staging for obsolescence {}", reader); // check this is: a reader guarded by the transaction, an instance we have already worked with // and that we haven't already obsoleted it, nor do we have other changes staged for it assert identities.contains(reader.instanceId) : "only reader instances that have previously been provided may be obsoleted: " + reader; assert originals.contains(reader) : "only readers in the 'original' set may be obsoleted: " + reader + " vs " + originals; assert !(logged.obsolete.contains(reader) || staged.obsolete.contains(reader)) : "may not obsolete a reader that has already been obsoleted: " + reader; assert !staged.update.contains(reader) : "may not obsolete a reader that has a staged update (must checkpoint first): " + reader; assert current(reader) == reader : "may only obsolete the latest version of the reader: " + reader; staged.obsolete.add(reader); }
/** * return the readers we're replacing in checkpoint(), i.e. the currently visible version of those in staged */ private Set<SSTableReader> toUpdate() { return copyOf(filterIn(current(), staged.obsolete, staged.update)); }
/** * return the readers we're replacing in checkpoint(), i.e. the currently visible version of those in staged */ private Set<SSTableReader> toUpdate() { return copyOf(filterIn(current(), staged.obsolete, staged.update)); }
/** * return the readers we're replacing in checkpoint(), i.e. the currently visible version of those in staged */ private Set<SSTableReader> toUpdate() { return copyOf(filterIn(current(), staged.obsolete, staged.update)); }
/** * obsolete every file in the original transaction */ public void obsoleteOriginals() { logger.trace("Staging for obsolescence {}", originals); // if we're obsoleting, we should have no staged updates for the original files assert Iterables.isEmpty(filterIn(staged.update, originals)) : staged.update; // stage obsoletes for any currently visible versions of any original readers Iterables.addAll(staged.obsolete, filterIn(current(), originals)); }
/** * obsolete every file in the original transaction */ public void obsoleteOriginals() { logger.trace("Staging for obsolescence {}", originals); // if we're obsoleting, we should have no staged updates for the original files assert Iterables.isEmpty(filterIn(staged.update, originals)) : staged.update; // stage obsoletes for any currently visible versions of any original readers Iterables.addAll(staged.obsolete, filterIn(current(), originals)); }
/** * update the current replacement of any original reader back to its original start */ private List<SSTableReader> restoreUpdatedOriginals() { Iterable<SSTableReader> torestore = filterIn(originals, logged.update, logged.obsolete); return ImmutableList.copyOf(transform(torestore, (reader) -> current(reader).cloneWithRestoredStart(reader.first))); }
/** * update the current replacement of any original reader back to its original start */ private List<SSTableReader> restoreUpdatedOriginals() { Iterable<SSTableReader> torestore = filterIn(originals, logged.update, logged.obsolete); return ImmutableList.copyOf(transform(torestore, (reader) -> current(reader).cloneWithRestoredStart(reader.first))); }
/** * update the current replacement of any original reader back to its original start */ private List<SSTableReader> restoreUpdatedOriginals() { Iterable<SSTableReader> torestore = filterIn(originals, logged.update, logged.obsolete); return ImmutableList.copyOf(transform(torestore, (reader) -> current(reader).cloneWithRestoredStart(reader.first))); }
/** * return the readers we're replacing in checkpoint(), i.e. the currently visible version of those in staged */ private Set<SSTableReader> toUpdate() { return copyOf(filterIn(current(), staged.obsolete, staged.update)); }
/** * obsolete every file in the original transaction */ public void obsoleteOriginals() { logger.trace("Staging for obsolescence {}", originals); // if we're obsoleting, we should have no staged updates for the original files assert Iterables.isEmpty(filterIn(staged.update, originals)) : staged.update; // stage obsoletes for any currently visible versions of any original readers Iterables.addAll(staged.obsolete, filterIn(current(), originals)); }
/** * update the current replacement of any original reader back to its original start */ private List<SSTableReader> restoreUpdatedOriginals() { Iterable<SSTableReader> torestore = filterIn(originals, logged.update, logged.obsolete); return ImmutableList.copyOf(transform(torestore, (reader) -> current(reader).cloneWithRestoredStart(reader.first))); }
final SSTableReader latest = transaction.current(sstable);
final SSTableReader latest = transaction.current(sstable);
final SSTableReader latest = transaction.current(sstable);