Class View
java.lang.Object
org.apache.cassandra.db.lifecycle.View
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 Summary
FieldsModifier and TypeFieldDescriptioncontains all memtables that are no longer referenced for writing and are queued for / in the process of being flushed.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. -
Method Summary
Modifier and TypeMethodDescriptiongetUncompacting(Iterable<SSTableReader> candidates) booleanisEmpty()liveSSTablesInBounds(PartitionPosition left, PartitionPosition right) Returns the sstables that have any partition betweenleftandright, when both bounds are taken inclusively.select(SSTableSet sstableSet) static com.google.common.base.Function<View,Iterable<SSTableReader>> select(SSTableSet sstableSet, com.google.common.base.Predicate<SSTableReader> filter) static com.google.common.base.Function<View,Iterable<SSTableReader>> select(SSTableSet sstableSet, DecoratedKey key) static com.google.common.base.Function<View,Iterable<SSTableReader>> selectFunction(SSTableSet sstableSet) static com.google.common.base.Function<View,Iterable<SSTableReader>> selectLive(AbstractBounds<PartitionPosition> rowBounds) sstables(SSTableSet sstableSet, com.google.common.base.Predicate<SSTableReader> filter) static List<SSTableReader>sstablesInBounds(PartitionPosition left, PartitionPosition right, SSTableIntervalTree intervalTree) toString()
-
Field Details
-
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
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 Details
-
getCurrentMemtable
-
getAllMemtables
- Returns:
- the active memtable and all the memtables that are pending flush.
-
liveSSTables
-
sstables
public Iterable<SSTableReader> sstables(SSTableSet sstableSet, com.google.common.base.Predicate<SSTableReader> filter) -
allKnownSSTables
-
select
-
getUncompacting
-
isEmpty
public boolean isEmpty() -
toString
-
liveSSTablesInBounds
public Iterable<SSTableReader> liveSSTablesInBounds(PartitionPosition left, PartitionPosition right) Returns the sstables that have any partition betweenleftandright, when both bounds are taken inclusively. The interval formed byleftandrightshouldn't wrap. -
sstablesInBounds
public static List<SSTableReader> sstablesInBounds(PartitionPosition left, PartitionPosition right, SSTableIntervalTree intervalTree) -
selectFunction
public static com.google.common.base.Function<View,Iterable<SSTableReader>> selectFunction(SSTableSet sstableSet) -
select
public static com.google.common.base.Function<View,Iterable<SSTableReader>> select(SSTableSet sstableSet, com.google.common.base.Predicate<SSTableReader> filter) -
select
public static com.google.common.base.Function<View,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,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.
-