ArrayBackedSortedColumns (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.db

## Class ArrayBackedSortedColumns

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

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

      public class ArrayBackedSortedColumns
      extends ColumnFamily

  A ColumnFamily backed by an array. This implementation is not synchronized and should only be used when thread-safety is not required. This implementation makes sense when the main operations performed are iterating over the cells and adding cells (especially if insertion is in sorted order).

- - ### Nested Class Summary

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

      `ColumnFamily.Factory<T extends ColumnFamily>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ColumnFamily.Factory<ArrayBackedSortedColumns>` | `factory`

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

      `metadata, serializer`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ArrayBackedSortedColumns(CFMetaData metadata, boolean reversed)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAll(ColumnFamily other)` Adds all the columns of a given column map to this column map.
    `void` | `addColumn(Cell cell)` Adds a cell to this cell map.
    `void` | `clear()` Clear this column family, removing all columns and deletion info.
    `ColumnFamily` | `cloneMe()` Clones the column map.
    `void` | `delete(DeletionInfo newInfo)`
    `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.
    `static ArrayBackedSortedColumns` | `localCopy(ColumnFamily original, AbstractAllocator allocator)`
    `void` | `maybeAppendColumn(Cell cell, DeletionInfo.InOrderTester tester, int gcBefore)` Adds a cell, assuming that: - it's non-gc-able (if a tombstone) or not a tombstone - it has a more recent timestamp than any partition/range tombstone shadowing it - it sorts *strictly after* the current-last cell in the array.
    `void` | `purgeTombstones(int gcBefore)` Purges any tombstones with a local deletion time before 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.
    `void` | `setDeletionInfo(DeletionInfo newInfo)`

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

      `addAtom, addColumn, addColumn, addCounter, addTombstone, addTombstone, asMap, 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`

- - ### Field Detail

    - #### factory

          public static final ColumnFamily.Factory<ArrayBackedSortedColumns> factory

  - ### Constructor Detail

    - #### ArrayBackedSortedColumns

          protected ArrayBackedSortedColumns(CFMetaData metadata,
                                  boolean reversed)

  - ### Method Detail

    - #### localCopy

          public static ArrayBackedSortedColumns localCopy(ColumnFamily original,
                                           AbstractAllocator allocator)

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

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

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

    - #### maybeAppendColumn

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

      Adds a cell, assuming that: - it's non-gc-able (if a tombstone) or not a tombstone - it has a more recent timestamp than any partition/range tombstone shadowing it - it sorts *strictly after* the current-last cell in the array.
      Specified by:
        `maybeAppendColumn` in class `ColumnFamily`

    - #### addColumn

          public void addColumn(Cell cell)

      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`

    - #### addAll

          public void addAll(ColumnFamily other)

      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`

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

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

    - #### deletionInfo

          public DeletionInfo deletionInfo()

      Specified by:
        `deletionInfo` in class `ColumnFamily`

    - #### delete

          public void delete(DeletionTime delTime)

      Specified by:
        `delete` in class `ColumnFamily`

    - #### delete

          public void delete(DeletionInfo newInfo)

      Specified by:
        `delete` in class `ColumnFamily`

    - #### delete

          protected void delete(RangeTombstone tombstone)

      Specified by:
        `delete` in class `ColumnFamily`

    - #### setDeletionInfo

          public void setDeletionInfo(DeletionInfo newInfo)

      Specified by:
        `setDeletionInfo` in class `ColumnFamily`

    - #### purgeTombstones

          public void purgeTombstones(int gcBefore)

      Purges any tombstones with a local deletion time before gcBefore.
      Specified by:
        `purgeTombstones` in class `ColumnFamily`
      Parameters:
        `gcBefore` - a timestamp (in seconds) before which tombstones should be purged

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

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

Copyright © 2014 The Apache Software Foundation