org.apache.cassandra.db

## Class AtomicBTreeColumns

- java.lang.Object
- - org.apache.cassandra.db.ColumnFamily
  - - org.apache.cassandra.db.AtomicBTreeColumns

All Implemented Interfaces:
  java.lang.Iterable<Cell>, IRowCacheEntry

    public class AtomicBTreeColumns
    extends ColumnFamily

A thread-safe and atomic ISortedColumns implementation. Operations (in particular addAll) on this implemenation 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 columns have been added.

WARNING: removing element through getSortedColumns().iterator() is *not* supported

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.cassandra.db.ColumnFamily

`ColumnFamily.Factory<T extends ColumnFamily>`

### Field Summary

Fields
`static ColumnFamily.Factory<AtomicBTreeColumns>` `factory`

### Fields inherited from class org.apache.cassandra.db.ColumnFamily

`metadata, serializer`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addAll(ColumnFamily cf)` Adds all the columns of a given column map to this column map.
`org.apache.cassandra.db.AtomicBTreeColumns.ColumnUpdater` `addAllWithSizeDelta(ColumnFamily cm, MemtableAllocator allocator, OpOrder.Group writeOp, SecondaryIndexManager.Updater indexer)` This is only called by Memtable.resolve, so only AtomicBTreeColumns needs to implement it.
`void` `addColumn(Cell column)` Adds a cell to this cell map.
`void` `appendColumn(Cell cell)` Appends a cell.
`BatchRemoveIterator<Cell>` `batchRemoveIterator()`
`void` `clear()` Clear this column family, removing all columns and deletion info.
`ColumnFamily` `cloneMe()` Clones the column map.
`void` `delete(DeletionInfo info)`
`void` `delete(DeletionTime delTime)`
`protected void` `delete(RangeTombstone tombstone)`
`DeletionInfo` `deletionInfo()`
`Cell` `getColumn(CellName name)` Get a column given its name, returning null if the column is not present.
`int` `getColumnCount()` Returns the number of columns in this map.
`java.lang.Iterable<CellName>` `getColumnNames()` Returns an iterable with the names of columns in this column map in the same order as the underlying columns themselves.
`ColumnFamily.Factory` `getFactory()` Returns the factory used for this ISortedColumns implementation.
`java.util.Collection<Cell>` `getReverseSortedColumns()` Returns the columns of this column map as a collection.
`java.util.Collection<Cell>` `getSortedColumns()` Returns the columns of this column map as a collection.
`boolean` `hasColumns()` Returns whether or not there are any columns present.
`boolean` `isInsertReversed()` Returns if this map only support inserts in reverse order.
`java.util.Iterator<Cell>` `iterator(ColumnSlice[] slices)` Returns an iterator over the columns of this map that returns only the matching @param slices.
`void` `maybeAppendColumn(Cell cell, DeletionInfo.InOrderTester tester, int gcBefore)` Adds a cell if it's non-gc-able and isn't shadowed by a partition/range tombstone with a higher timestamp.
`void` `purgeTombstones(int gcBefore)` Purges top-level and range tombstones whose localDeletionTime is older than gcBefore.
`java.util.Iterator<Cell>` `reverseIterator(ColumnSlice[] slices)` Returns a reversed iterator over the columns of this map that returns only the matching @param slices.
`SearchIterator<CellName,Cell>` `searchIterator()`
`void` `setDeletionInfo(DeletionInfo newInfo)`

### Methods inherited from class org.apache.cassandra.db.ColumnFamily

`addAtom, addColumn, addColumn, addCounter, addTombstone, addTombstone, asMap, cloneMeShallow, cloneMeShallow, cloneMeShallow, dataSize, delete, diff, diff, digest, equals, fromBytes, getColumnStats, getComparator, getType, hashCode, hasOnlyTombstones, id, inOrderDeletionTester, isEmpty, isMarkedForDelete, iterator, liveCQL3RowCount, maxTimestamp, metadata, reverseIterator, toBytes, toString, updateDigest`

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

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

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

`forEach, spliterator`

### Field Detail

#### factory

    public static final ColumnFamily.Factory<AtomicBTreeColumns> factory

### Method Detail

#### getFactory

    public ColumnFamily.Factory getFactory()

Description copied from class: `ColumnFamily`
Returns the factory used for this ISortedColumns implementation.

Specified by:
  `getFactory` in class `ColumnFamily`

#### cloneMe

    public ColumnFamily cloneMe()

Description copied from class: `ColumnFamily`
Clones the column map.

Specified by:
  `cloneMe` in class `ColumnFamily`

#### deletionInfo

    public DeletionInfo deletionInfo()

Specified by:
  `deletionInfo` in class `ColumnFamily`

#### delete

    public void delete(DeletionTime delTime)

Specified by:
  `delete` in class `ColumnFamily`

#### delete

    protected void delete(RangeTombstone tombstone)

Specified by:
  `delete` in class `ColumnFamily`

#### searchIterator

    public SearchIterator<CellName,Cell> searchIterator()

Specified by:
  `searchIterator` in class `ColumnFamily`

#### delete

    public void delete(DeletionInfo info)

Specified by:
  `delete` in class `ColumnFamily`

#### setDeletionInfo

    public void setDeletionInfo(DeletionInfo newInfo)

Specified by:
  `setDeletionInfo` in class `ColumnFamily`

#### purgeTombstones

    public void purgeTombstones(int gcBefore)

Description copied from class: `ColumnFamily`
Purges top-level and range tombstones whose localDeletionTime is older than gcBefore.

Specified by:
  `purgeTombstones` in class `ColumnFamily`
Parameters:
  `gcBefore` - a timestamp (in seconds) before which tombstones should be purged

#### addAllWithSizeDelta

    public org.apache.cassandra.db.AtomicBTreeColumns.ColumnUpdater addAllWithSizeDelta(ColumnFamily cm,
                                                                                        MemtableAllocator allocator,
                                                                                        OpOrder.Group writeOp,
                                                                                        SecondaryIndexManager.Updater indexer)

This is only called by Memtable.resolve, so only AtomicBTreeColumns needs to implement it.

Returns:
  the difference in size seen after merging the given columns

#### addColumn

    public void addColumn(Cell column)

Description copied from class: `ColumnFamily`
Adds a cell to this cell map. If a cell with the same name is already present in the map, it will be replaced by the newly added cell.

Specified by:
  `addColumn` in class `ColumnFamily`

#### maybeAppendColumn

    public void maybeAppendColumn(Cell cell,
                                  DeletionInfo.InOrderTester tester,
                                  int gcBefore)

Description copied from class: `ColumnFamily`
Adds a cell if it's non-gc-able and isn't shadowed by a partition/range tombstone with a higher timestamp. Requires that the cell to add is sorted strictly after the last cell in the container.

Specified by:
  `maybeAppendColumn` in class `ColumnFamily`

#### appendColumn

    public void appendColumn(Cell cell)

Description copied from class: `ColumnFamily`
Appends a cell. Requires that the cell to add is sorted strictly after the last cell in the container.

Specified by:
  `appendColumn` in class `ColumnFamily`

#### addAll

    public void addAll(ColumnFamily cf)

Description copied from class: `ColumnFamily`
Adds all the columns of a given column map to this column map. This is equivalent to: `for (Cell c : cm) addColumn(c, ...);` but is potentially faster.

Specified by:
  `addAll` in class `ColumnFamily`

#### clear

    public void clear()

Description copied from class: `ColumnFamily`
Clear this column family, removing all columns and deletion info.

Specified by:
  `clear` in class `ColumnFamily`

#### getColumn

    public Cell getColumn(CellName name)

Description copied from class: `ColumnFamily`
Get a column given its name, returning null if the column is not present.

Specified by:
  `getColumn` in class `ColumnFamily`

#### getColumnNames

    public java.lang.Iterable<CellName> getColumnNames()

Description copied from class: `ColumnFamily`
Returns an iterable with the names of columns in this column map in the same order as the underlying columns themselves.

Specified by:
  `getColumnNames` in class `ColumnFamily`

#### getSortedColumns

    public java.util.Collection<Cell> getSortedColumns()

Description copied from class: `ColumnFamily`
Returns the columns of this column map as a collection. The columns in the returned collection should be sorted as the columns in this map.

Specified by:
  `getSortedColumns` in class `ColumnFamily`

#### getReverseSortedColumns

    public java.util.Collection<Cell> getReverseSortedColumns()

Description copied from class: `ColumnFamily`
Returns the columns of this column map as a collection. The columns in the returned collection should be sorted in reverse order of the columns in this map.

Specified by:
  `getReverseSortedColumns` in class `ColumnFamily`

#### getColumnCount

    public int getColumnCount()

Description copied from class: `ColumnFamily`
Returns the number of columns in this map.

Specified by:
  `getColumnCount` in class `ColumnFamily`

#### hasColumns

    public boolean hasColumns()

Description copied from class: `ColumnFamily`
Returns whether or not there are any columns present.

Specified by:
  `hasColumns` in class `ColumnFamily`

#### iterator

    public java.util.Iterator<Cell> iterator(ColumnSlice[] slices)

Description copied from class: `ColumnFamily`
Returns an iterator over the columns of this map that returns only the matching @param slices. The provided slices must be in order and must be non-overlapping.

Specified by:
  `iterator` in class `ColumnFamily`

#### reverseIterator

    public java.util.Iterator<Cell> reverseIterator(ColumnSlice[] slices)

Description copied from class: `ColumnFamily`
Returns a reversed iterator over the columns of this map that returns only the matching @param slices. The provided slices must be in reversed order and must be non-overlapping.

Specified by:
  `reverseIterator` in class `ColumnFamily`

#### isInsertReversed

    public boolean isInsertReversed()

Description copied from class: `ColumnFamily`
Returns if this map only support inserts in reverse order.

Specified by:
  `isInsertReversed` in class `ColumnFamily`

#### batchRemoveIterator

    public BatchRemoveIterator<Cell> batchRemoveIterator()

Specified by:
  `batchRemoveIterator` in class `ColumnFamily`
Returns:
  an iterator where the removes are carried out once everything has been iterated