org.apache.cassandra.db.lifecycle

## Class View

- java.lang.Object
- - org.apache.cassandra.db.lifecycle.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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.util.Set<SSTableReader>` | `compacting`
    `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.
    `SSTableIntervalTree` | `intervalTree`
    `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.
    `java.util.Set<SSTableReader>` | `premature`
    `java.util.Set<SSTableReader>` | `sstables`
    `java.util.Map<SSTableReader,SSTableReader>` | `sstablesMap`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Iterable<Memtable>` | `getAllMemtables()`
    `Memtable` | `getCurrentMemtable()`
    `java.lang.Iterable<SSTableReader>` | `getUncompacting(java.lang.Iterable<SSTableReader> candidates)`
    `com.google.common.collect.Sets.SetView<SSTableReader>` | `nonCompactingSStables()`
    `java.util.List<SSTableReader>` | `sstablesInBounds(RowPosition left, RowPosition right)` Returns the sstables that have any partition between `left` and `right`, when both bounds are taken inclusively.
    `static java.util.List<SSTableReader>` | `sstablesInBounds(RowPosition left, RowPosition right, SSTableIntervalTree intervalTree)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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.

    - #### compacting

          public final java.util.Set<SSTableReader> compacting

    - #### sstables

          public final java.util.Set<SSTableReader> sstables

    - #### premature

          public final java.util.Set<SSTableReader> premature

    - #### sstablesMap

          public final java.util.Map<SSTableReader,SSTableReader> sstablesMap

    - #### intervalTree

          public final SSTableIntervalTree intervalTree

  - ### 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.

    - #### nonCompactingSStables

          public com.google.common.collect.Sets.SetView<SSTableReader> nonCompactingSStables()

    - #### getUncompacting

          public java.lang.Iterable<SSTableReader> getUncompacting(java.lang.Iterable<SSTableReader> candidates)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### sstablesInBounds

          public java.util.List<SSTableReader> sstablesInBounds(RowPosition left,
                                                                RowPosition 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.

    - #### sstablesInBounds

          public static java.util.List<SSTableReader> sstablesInBounds(RowPosition left,
                                                                       RowPosition right,
                                                                       SSTableIntervalTree intervalTree)

Copyright © 2018 The Apache Software Foundation