org.apache.cassandra.db.lifecycle

## Class Tracker

- java.lang.Object
- - org.apache.cassandra.db.lifecycle.Tracker

-     public class Tracker
      extends java.lang.Object

  Tracker tracks live `View` of data store for a table.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `ColumnFamilyStore` | `cfstore`
    `boolean` | `loadsstables`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Tracker(Memtable memtable, boolean loadsstables)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addInitialSSTables(java.lang.Iterable<SSTableReader> sstables)`
    `void` | `addSSTables(java.lang.Iterable<SSTableReader> sstables)`
    `void` | `dropSSTables()`
    `java.lang.Throwable` | `dropSSTables(com.google.common.base.Predicate<SSTableReader> remove, OperationType operationType, java.lang.Throwable accumulate)` removes all sstables that are not busy compacting.
    `java.lang.Throwable` | `dropSSTables(java.lang.Throwable accumulate)`
    `java.lang.Throwable` | `dropSSTablesIfInvalid(java.lang.Throwable accumulate)`
    `java.util.Set<SSTableReader>` | `getCompacting()`
    `Memtable` | `getMemtableFor(OpOrder.Group opGroup, ReplayPosition replayPosition)` get the Memtable that the ordered writeOp should be directed to
    `java.lang.Iterable<SSTableReader>` | `getPermittedToCompact()`
    `java.util.Set<SSTableReader>` | `getSSTables()`
    `java.util.Set<SSTableReader>` | `getUncompacting()`
    `java.lang.Iterable<SSTableReader>` | `getUncompacting(java.lang.Iterable<SSTableReader> candidates)`
    `View` | `getView()`
    `boolean` | `isDummy()`
    `void` | `markFlushing(Memtable memtable)`
    `void` | `maybeIncrementallyBackup(SSTableReader sstable)`
    `void` | `notifyAdded(SSTableReader added)`
    `void` | `notifyDeleting(SSTableReader deleting)`
    `void` | `notifyRenewed(Memtable renewed)`
    `void` | `notifySSTableRepairedStatusChanged(java.util.Collection<SSTableReader> repairStatusesChanged)`
    `void` | `notifyTruncated(long truncatedAt)`
    `void` | `permitCompactionOfFlushed(SSTableReader sstable)` permit compaction of the provided sstable; this translates to notifying compaction strategies of its existence, and potentially submitting a background task
    `void` | `removeUnreadableSSTables(java.io.File directory)` Removes every SSTable in the directory from the Tracker's view.
    `void` | `replaceFlushed(Memtable memtable, SSTableReader sstable)`
    `void` | `reset(Memtable memtable)` (Re)initializes the tracker, purging all references.
    `void` | `subscribe(INotificationConsumer consumer)`
    `Memtable` | `switchMemtable(boolean truncating, Memtable newMemtable)` Switch the current memtable.
    `LifecycleTransaction` | `tryModify(java.lang.Iterable<SSTableReader> sstables, OperationType operationType)`
    `LifecycleTransaction` | `tryModify(SSTableReader sstable, OperationType operationType)`
    `void` | `unsubscribe(INotificationConsumer consumer)`

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

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

- - ### Field Detail

    - #### cfstore

          public final ColumnFamilyStore cfstore

    - #### loadsstables

          public final boolean loadsstables

  - ### Constructor Detail

    - #### Tracker

          public Tracker(Memtable memtable,
                         boolean loadsstables)

      Parameters:
        `memtable` - Initial Memtable. Can be null.
        `loadsstables` - true to indicate to load SSTables (TODO: remove as this is only accessed from 2i)

  - ### Method Detail

    - #### tryModify

          public LifecycleTransaction tryModify(SSTableReader sstable,
                                                OperationType operationType)

    - #### tryModify

          public LifecycleTransaction tryModify(java.lang.Iterable<SSTableReader> sstables,
                                                OperationType operationType)

      Returns:
        a Transaction over the provided sstables if we are able to mark the given @param sstables as compacted, before anyone else

    - #### addInitialSSTables

          public void addInitialSSTables(java.lang.Iterable<SSTableReader> sstables)

    - #### addSSTables

          public void addSSTables(java.lang.Iterable<SSTableReader> sstables)

    - #### reset

          public void reset(Memtable memtable)

      (Re)initializes the tracker, purging all references.

    - #### dropSSTablesIfInvalid

          public java.lang.Throwable dropSSTablesIfInvalid(java.lang.Throwable accumulate)

    - #### dropSSTables

          public void dropSSTables()

    - #### dropSSTables

          public java.lang.Throwable dropSSTables(java.lang.Throwable accumulate)

    - #### dropSSTables

          public java.lang.Throwable dropSSTables(com.google.common.base.Predicate<SSTableReader> remove,
                                                  OperationType operationType,
                                                  java.lang.Throwable accumulate)

      removes all sstables that are not busy compacting.

    - #### removeUnreadableSSTables

          public void removeUnreadableSSTables(java.io.File directory)

      Removes every SSTable in the directory from the Tracker's view.
      Parameters:
        `directory` - the unreadable directory, possibly with SSTables in it, but not necessarily.

    - #### getMemtableFor

          public Memtable getMemtableFor(OpOrder.Group opGroup,
                                         ReplayPosition replayPosition)

      get the Memtable that the ordered writeOp should be directed to

    - #### switchMemtable

          public Memtable switchMemtable(boolean truncating,
                                         Memtable newMemtable)

      Switch the current memtable. This atomically appends a new memtable to the end of the list of active memtables, returning the previously last memtable. It leaves the previous Memtable in the list of live memtables until discarding(memtable) is called. These two methods must be synchronized/paired, i.e. m = switchMemtable must be followed by discarding(m), they cannot be interleaved.
      Returns:
        the previously active memtable

    - #### markFlushing

          public void markFlushing(Memtable memtable)

    - #### replaceFlushed

          public void replaceFlushed(Memtable memtable,
                                     SSTableReader sstable)

    - #### permitCompactionOfFlushed

          public void permitCompactionOfFlushed(SSTableReader sstable)

      permit compaction of the provided sstable; this translates to notifying compaction strategies of its existence, and potentially submitting a background task

    - #### getSSTables

          public java.util.Set<SSTableReader> getSSTables()

    - #### getPermittedToCompact

          public java.lang.Iterable<SSTableReader> getPermittedToCompact()

    - #### getCompacting

          public java.util.Set<SSTableReader> getCompacting()

    - #### getUncompacting

          public java.util.Set<SSTableReader> getUncompacting()

    - #### getUncompacting

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

    - #### maybeIncrementallyBackup

          public void maybeIncrementallyBackup(SSTableReader sstable)

    - #### notifyAdded

          public void notifyAdded(SSTableReader added)

    - #### notifySSTableRepairedStatusChanged

          public void notifySSTableRepairedStatusChanged(java.util.Collection<SSTableReader> repairStatusesChanged)

    - #### notifyDeleting

          public void notifyDeleting(SSTableReader deleting)

    - #### notifyRenewed

          public void notifyRenewed(Memtable renewed)

    - #### notifyTruncated

          public void notifyTruncated(long truncatedAt)

    - #### isDummy

          public boolean isDummy()

    - #### subscribe

          public void subscribe(INotificationConsumer consumer)

    - #### unsubscribe

          public void unsubscribe(INotificationConsumer consumer)

    - #### getView

          public View getView()

Copyright © 2018 The Apache Software Foundation