org.apache.cassandra.db.partitions

## Class AtomicBTreePartition

- java.lang.Object
- - org.apache.cassandra.db.partitions.AbstractBTreePartition
  - - org.apache.cassandra.db.partitions.AtomicBTreePartition

- All Implemented Interfaces:
    java.lang.Iterable<Row>, Partition

      public class AtomicBTreePartition
      extends AbstractBTreePartition

  A thread-safe and atomic Partition implementation. Operations (in particular addAll) on this implementation are atomic and isolated (in the sense of ACID). Typically a addAll is guaranteed that no other thread can see the state where only parts but not all rows have been added.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition

      `AbstractBTreePartition.Holder, AbstractBTreePartition.SlicesIterator`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static long` | `EMPTY_SIZE`

    - ### Fields inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition

      `EMPTY, metadata, partitionKey`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AtomicBTreePartition(CFMetaData metadata, DecoratedKey partitionKey, MemtableAllocator allocator)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long[]` | `addAllWithSizeDelta(PartitionUpdate update, OpOrder.Group writeOp, UpdateTransaction indexer)` Adds a given update to this in-memtable partition.
    `protected boolean` | `canHaveShadowedData()`
    `DeletionInfo` | `deletionInfo()`
    `Row` | `getRow(Clustering clustering)` Returns the row corresponding to the provided clustering, or null if there is not such row.
    `protected AbstractBTreePartition.Holder` | `holder()`
    `java.util.Iterator<Row>` | `iterator()`
    `Row` | `lastRow()`
    `DecoratedKey` | `partitionKey()`
    `SearchIterator<Clustering,Row>` | `searchIterator(ColumnFilter columns, boolean reversed)` Returns an iterator that allows to search specific rows efficiently.
    `Row` | `staticRow()`
    `UnfilteredRowIterator` | `unfilteredIterator()` Returns an UnfilteredRowIterator over all the rows/RT contained by this partition.
    `UnfilteredRowIterator` | `unfilteredIterator(AbstractBTreePartition.Holder current, ColumnFilter selection, Slices slices, boolean reversed)`
    `UnfilteredRowIterator` | `unfilteredIterator(ColumnFilter selection, Slices slices, boolean reversed)` Returns an UnfilteredRowIterator over the rows/RT contained by this partition selected by the provided slices.
    `boolean` | `usePessimisticLocking()`

    - ### Methods inherited from class org.apache.cassandra.db.partitions.AbstractBTreePartition

      `build, build, build, columns, hasRows, isEmpty, metadata, partitionLevelDeletion, rowCount, stats, toString`

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

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

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### EMPTY_SIZE

          public static final long EMPTY_SIZE

  - ### Constructor Detail

    - #### AtomicBTreePartition

          public AtomicBTreePartition(CFMetaData metadata,
                                      DecoratedKey partitionKey,
                                      MemtableAllocator allocator)

  - ### Method Detail

    - #### holder

          protected AbstractBTreePartition.Holder holder()

      Specified by:
        `holder` in class `AbstractBTreePartition`

    - #### canHaveShadowedData

          protected boolean canHaveShadowedData()

      Specified by:
        `canHaveShadowedData` in class `AbstractBTreePartition`

    - #### addAllWithSizeDelta

          public long[] addAllWithSizeDelta(PartitionUpdate update,
                                            OpOrder.Group writeOp,
                                            UpdateTransaction indexer)

      Adds a given update to this in-memtable partition.
      Returns:
        an array containing first the difference in size seen after merging the updates, and second the minimum time detla between updates.

    - #### deletionInfo

          public DeletionInfo deletionInfo()

      Overrides:
        `deletionInfo` in class `AbstractBTreePartition`

    - #### staticRow

          public Row staticRow()

      Overrides:
        `staticRow` in class `AbstractBTreePartition`

    - #### partitionKey

          public DecoratedKey partitionKey()

      Specified by:
        `partitionKey` in interface `Partition`
      Overrides:
        `partitionKey` in class `AbstractBTreePartition`

    - #### getRow

          public Row getRow(Clustering clustering)

      Description copied from interface: `Partition`
      Returns the row corresponding to the provided clustering, or null if there is not such row.
      Specified by:
        `getRow` in interface `Partition`
      Overrides:
        `getRow` in class `AbstractBTreePartition`

    - #### lastRow

          public Row lastRow()

      Overrides:
        `lastRow` in class `AbstractBTreePartition`

    - #### searchIterator

          public SearchIterator<Clustering,Row> searchIterator(ColumnFilter columns,
                                                               boolean reversed)

      Description copied from interface: `Partition`
      Returns an iterator that allows to search specific rows efficiently.
      Specified by:
        `searchIterator` in interface `Partition`
      Overrides:
        `searchIterator` in class `AbstractBTreePartition`

    - #### unfilteredIterator

          public UnfilteredRowIterator unfilteredIterator(ColumnFilter selection,
                                                          Slices slices,
                                                          boolean reversed)

      Description copied from interface: `Partition`
      Returns an UnfilteredRowIterator over the rows/RT contained by this partition selected by the provided slices.
      Specified by:
        `unfilteredIterator` in interface `Partition`
      Overrides:
        `unfilteredIterator` in class `AbstractBTreePartition`

    - #### unfilteredIterator

          public UnfilteredRowIterator unfilteredIterator()

      Description copied from interface: `Partition`
      Returns an UnfilteredRowIterator over all the rows/RT contained by this partition.
      Specified by:
        `unfilteredIterator` in interface `Partition`
      Overrides:
        `unfilteredIterator` in class `AbstractBTreePartition`

    - #### unfilteredIterator

          public UnfilteredRowIterator unfilteredIterator(AbstractBTreePartition.Holder current,
                                                          ColumnFilter selection,
                                                          Slices slices,
                                                          boolean reversed)

      Overrides:
        `unfilteredIterator` in class `AbstractBTreePartition`

    - #### iterator

          public java.util.Iterator<Row> iterator()

      Specified by:
        `iterator` in interface `java.lang.Iterable<Row>`
      Overrides:
        `iterator` in class `AbstractBTreePartition`

    - #### usePessimisticLocking

          public boolean usePessimisticLocking()

Copyright © 2018 The Apache Software Foundation