public static SSTableIntervalTree build(Iterable<SSTableReader> sstables) { return new SSTableIntervalTree(buildIntervals(sstables)); }
public static List<SSTableReader> sstablesInBounds(PartitionPosition left, PartitionPosition right, SSTableIntervalTree intervalTree) { assert !AbstractBounds.strictlyWrapsAround(left, right); if (intervalTree.isEmpty()) return Collections.emptyList(); PartitionPosition stopInTree = right.isMinimum() ? intervalTree.max() : right; return intervalTree.search(Interval.create(left, stopInTree)); }
/** (Re)initializes the tracker, purging all references. */ @VisibleForTesting public void reset(Memtable memtable) { view.set(new View(memtable != null ? singletonList(memtable) : Collections.emptyList(), Collections.emptyList(), Collections.emptyMap(), Collections.emptyMap(), SSTableIntervalTree.empty())); }
public View apply(View view) { Map<SSTableReader, SSTableReader> sstableMap = replace(view.sstablesMap, remove, add); return new View(view.liveMemtables, view.flushingMemtables, sstableMap, view.compactingMap, SSTableIntervalTree.build(sstableMap.keySet())); } };
/** * @return a ViewFragment containing the sstables and memtables that may need to be merged * for the given @param key, according to the interval tree */ public static Function<View, Iterable<SSTableReader>> select(SSTableSet sstableSet, DecoratedKey key) { assert sstableSet == SSTableSet.LIVE; return (view) -> view.intervalTree.search(key); }
private void refreshOverlaps() { if (NEVER_PURGE_TOMBSTONES) return; if (this.overlappingSSTables != null) close(); if (compacting == null || ignoreOverlaps()) overlappingSSTables = Refs.tryRef(Collections.<SSTableReader>emptyList()); else overlappingSSTables = cfs.getAndReferenceOverlappingLiveSSTables(compacting); this.overlapIterator = new OverlapIterator<>(buildIntervals(overlappingSSTables)); }
public View apply(View view) { Map<SSTableReader, SSTableReader> sstableMap = replace(view.sstablesMap, remove, add); return new View(view.liveMemtables, view.flushingMemtables, sstableMap, view.compactingMap, SSTableIntervalTree.build(sstableMap.keySet())); } };
/** * @return a ViewFragment containing the sstables and memtables that may need to be merged * for the given @param key, according to the interval tree */ public static Function<View, Iterable<SSTableReader>> select(SSTableSet sstableSet, DecoratedKey key) { assert sstableSet == SSTableSet.LIVE; return (view) -> view.intervalTree.search(key); }
private void refreshOverlaps() { if (NEVER_PURGE_TOMBSTONES) return; if (this.overlappingSSTables != null) close(); if (compacting == null || ignoreOverlaps()) overlappingSSTables = Refs.tryRef(Collections.<SSTableReader>emptyList()); else overlappingSSTables = cfs.getAndReferenceOverlappingLiveSSTables(compacting); this.overlapIterator = new OverlapIterator<>(buildIntervals(overlappingSSTables)); }
public static List<SSTableReader> sstablesInBounds(PartitionPosition left, PartitionPosition right, SSTableIntervalTree intervalTree) { assert !AbstractBounds.strictlyWrapsAround(left, right); if (intervalTree.isEmpty()) return Collections.emptyList(); PartitionPosition stopInTree = right.isMinimum() ? intervalTree.max() : right; return intervalTree.search(Interval.create(left, stopInTree)); }
public View apply(View view) { Map<SSTableReader, SSTableReader> sstableMap = replace(view.sstablesMap, remove, add); return new View(view.liveMemtables, view.flushingMemtables, sstableMap, view.compactingMap, SSTableIntervalTree.build(sstableMap.keySet())); } };
public static SSTableIntervalTree build(Iterable<SSTableReader> sstables) { return new SSTableIntervalTree(buildIntervals(sstables)); }
/** * @return a ViewFragment containing the sstables and memtables that may need to be merged * for the given @param key, according to the interval tree */ public static Function<View, Iterable<SSTableReader>> select(SSTableSet sstableSet, DecoratedKey key) { assert sstableSet == SSTableSet.LIVE; return (view) -> view.intervalTree.search(key); }
private void refreshOverlaps() { if (NEVER_PURGE_TOMBSTONES) return; if (this.overlappingSSTables != null) close(); if (compacting == null || ignoreOverlaps()) overlappingSSTables = Refs.tryRef(Collections.<SSTableReader>emptyList()); else overlappingSSTables = cfs.getAndReferenceOverlappingLiveSSTables(compacting); this.overlapIterator = new OverlapIterator<>(buildIntervals(overlappingSSTables)); }
/** (Re)initializes the tracker, purging all references. */ @VisibleForTesting public void reset(Memtable memtable) { view.set(new View(memtable != null ? singletonList(memtable) : Collections.emptyList(), Collections.emptyList(), Collections.emptyMap(), Collections.emptyMap(), SSTableIntervalTree.empty())); }
/** * Returns the sstables that have any partition between {@code left} and {@code right}, when both bounds are taken inclusively. * The interval formed by {@code left} and {@code right} shouldn't wrap. */ public Iterable<SSTableReader> liveSSTablesInBounds(PartitionPosition left, PartitionPosition right) { assert !AbstractBounds.strictlyWrapsAround(left, right); if (intervalTree.isEmpty()) return Collections.emptyList(); PartitionPosition stopInTree = right.isMinimum() ? intervalTree.max() : right; return intervalTree.search(Interval.create(left, stopInTree)); }
public View apply(View view) { List<Memtable> flushingMemtables = copyOf(filter(view.flushingMemtables, not(equalTo(memtable)))); assert flushingMemtables.size() == view.flushingMemtables.size() - 1; if (flushed == null || Iterables.isEmpty(flushed)) return new View(view.liveMemtables, flushingMemtables, view.sstablesMap, view.compactingMap, view.intervalTree); Map<SSTableReader, SSTableReader> sstableMap = replace(view.sstablesMap, emptySet(), flushed); return new View(view.liveMemtables, flushingMemtables, sstableMap, view.compactingMap, SSTableIntervalTree.build(sstableMap.keySet())); } };
public static SSTableIntervalTree build(Iterable<SSTableReader> sstables) { return new SSTableIntervalTree(buildIntervals(sstables)); }
/** * @return a ViewFragment containing the sstables and memtables that may need to be merged * for the given @param key, according to the interval tree */ public static Function<View, Iterable<SSTableReader>> select(SSTableSet sstableSet, DecoratedKey key) { assert sstableSet == SSTableSet.LIVE; return (view) -> view.intervalTree.search(key); }
/** (Re)initializes the tracker, purging all references. */ @VisibleForTesting public void reset(Memtable memtable) { view.set(new View(memtable != null ? singletonList(memtable) : Collections.emptyList(), Collections.emptyList(), Collections.emptyMap(), Collections.emptyMap(), SSTableIntervalTree.empty())); }