Class View


  • public class View
    extends java.lang.Object
    An immutable structure holding the current memtable, the memtables pending flush, the sstables for a column family, and the sstables that are active in compaction (a subset of the sstables). Modifications to instances are all performed via a Function produced by the static methods in this class. These are composed as necessary and provided to the Tracker.apply() methods, which atomically reject or accept and apply the changes to the View.
    • Field Detail

      • liveMemtables

        public final java.util.List<Memtable> liveMemtables
        ordinarily a list of size 1, but when preparing to flush will contain both the memtable we will flush and the new replacement memtable, until all outstanding write operations on the old table complete. The last item in the list is always the "current" memtable.
      • flushingMemtables

        public final java.util.List<Memtable> flushingMemtables
        contains all memtables that are no longer referenced for writing and are queued for / in the process of being flushed. In chronologically ascending order.
    • Method Detail

      • getCurrentMemtable

        public Memtable getCurrentMemtable()
      • getAllMemtables

        public java.lang.Iterable<Memtable> getAllMemtables()
        Returns:
        the active memtable and all the memtables that are pending flush.
      • liveSSTables

        public java.util.Set<SSTableReader> liveSSTables()
      • allKnownSSTables

        public java.lang.Iterable<SSTableReader> allKnownSSTables()
      • isEmpty

        public boolean isEmpty()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • liveSSTablesInBounds

        public java.lang.Iterable<SSTableReader> liveSSTablesInBounds​(PartitionPosition left,
                                                                      PartitionPosition right)
        Returns the sstables that have any partition between left and right, when both bounds are taken inclusively. The interval formed by left and right shouldn't wrap.
      • selectFunction

        public static com.google.common.base.Function<View,​java.lang.Iterable<SSTableReader>> selectFunction​(SSTableSet sstableSet)
      • select

        public static com.google.common.base.Function<View,​java.lang.Iterable<SSTableReader>> select​(SSTableSet sstableSet,
                                                                                                           DecoratedKey key)
        Returns:
        a ViewFragment containing the sstables and memtables that may need to be merged for the given @param key, according to the interval tree
      • selectLive

        public static com.google.common.base.Function<View,​java.lang.Iterable<SSTableReader>> selectLive​(AbstractBounds<PartitionPosition> rowBounds)
        Returns:
        a ViewFragment containing the sstables and memtables that may need to be merged for rows within @param rowBounds, inclusive, according to the interval tree.