org.apache.cassandra.db
Interface ISortedColumns

All Superinterfaces:
IIterableColumns, java.lang.Iterable<IColumn>
All Known Implementing Classes:
AbstractThreadUnsafeSortedColumns, ArrayBackedSortedColumns, AtomicSortedColumns, ThreadSafeSortedColumns, TreeMapBackedSortedColumns

public interface ISortedColumns
extends IIterableColumns

A sorted map of columns. This represents the backing map of a colum family. Whether the implementation is thread safe or not is left to the implementing classes.


Nested Class Summary
static interface ISortedColumns.Factory
           
 
Method Summary
 void addAll(ISortedColumns cm, Allocator allocator, com.google.common.base.Function<IColumn,IColumn> transformation)
          Adds the columns without necessarily computing the size delta
 long addAllWithSizeDelta(ISortedColumns cm, Allocator allocator, com.google.common.base.Function<IColumn,IColumn> transformation, SecondaryIndexManager.Updater indexer)
          Adds all the columns of a given column map to this column map.
 void addColumn(IColumn column, Allocator allocator)
          Adds a column to this column map.
 void clear()
          Clear this column map, removing all columns.
 ISortedColumns cloneMe()
          Shallow cloning of the column map.
 void delete(DeletionInfo info)
           
 IColumn getColumn(java.nio.ByteBuffer name)
          Get a column given its name, returning null if the column is not present.
 java.util.SortedSet<java.nio.ByteBuffer> getColumnNames()
          Returns a set with the names of columns in this column map.
 DeletionInfo getDeletionInfo()
           
 ISortedColumns.Factory getFactory()
          Returns the factory used for this ISortedColumns implementation.
 java.util.Collection<IColumn> getReverseSortedColumns()
          Returns the columns of this column map as a collection.
 java.util.Collection<IColumn> getSortedColumns()
          Returns the columns of this column map as a collection.
 boolean isEmpty()
          Returns true if this map is empty, false otherwise.
 boolean isInsertReversed()
          Returns if this map only support inserts in reverse order.
 java.util.Iterator<IColumn> iterator(ColumnSlice[] slices)
          Returns an iterator over the columns of this map that returns only the matching @param slices.
 void maybeResetDeletionTimes(int gcBefore)
           
 void removeColumn(java.nio.ByteBuffer name)
          Remove if present a column by name.
 boolean replace(IColumn oldColumn, IColumn newColumn)
          Replace oldColumn if present by newColumn.
 void retainAll(ISortedColumns columns)
           
 java.util.Iterator<IColumn> reverseIterator(ColumnSlice[] slices)
          Returns a reversed iterator over the columns of this map that returns only the matching @param slices.
 void setDeletionInfo(DeletionInfo info)
           
 int size()
          Returns the number of columns in this map.
 
Methods inherited from interface org.apache.cassandra.io.util.IIterableColumns
getComparator, getEstimatedColumnCount
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

cloneMe

ISortedColumns cloneMe()
Shallow cloning of the column map.


getFactory

ISortedColumns.Factory getFactory()
Returns the factory used for this ISortedColumns implementation.


getDeletionInfo

DeletionInfo getDeletionInfo()

setDeletionInfo

void setDeletionInfo(DeletionInfo info)

delete

void delete(DeletionInfo info)

maybeResetDeletionTimes

void maybeResetDeletionTimes(int gcBefore)

retainAll

void retainAll(ISortedColumns columns)

addColumn

void addColumn(IColumn column,
               Allocator allocator)
Adds a column to this column map. If a column with the same name is already present in the map, it will be replaced by the newly added column.


addAllWithSizeDelta

long addAllWithSizeDelta(ISortedColumns cm,
                         Allocator allocator,
                         com.google.common.base.Function<IColumn,IColumn> transformation,
                         SecondaryIndexManager.Updater indexer)
Adds all the columns of a given column map to this column map. This is equivalent to: for (Column c : cm) add(c); but is potentially faster.

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

addAll

void addAll(ISortedColumns cm,
            Allocator allocator,
            com.google.common.base.Function<IColumn,IColumn> transformation)
Adds the columns without necessarily computing the size delta


replace

boolean replace(IColumn oldColumn,
                IColumn newColumn)
Replace oldColumn if present by newColumn. Returns true if oldColumn was present and thus replaced. oldColumn and newColumn should have the same name.


removeColumn

void removeColumn(java.nio.ByteBuffer name)
Remove if present a column by name.


clear

void clear()
Clear this column map, removing all columns.


getColumn

IColumn getColumn(java.nio.ByteBuffer name)
Get a column given its name, returning null if the column is not present.


getColumnNames

java.util.SortedSet<java.nio.ByteBuffer> getColumnNames()
Returns a set with the names of columns in this column map. The resulting set is sorted and the order is the one of the columns in this column map.


getSortedColumns

java.util.Collection<IColumn> getSortedColumns()
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.


getReverseSortedColumns

java.util.Collection<IColumn> getReverseSortedColumns()
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.


size

int size()
Returns the number of columns in this map.


isEmpty

boolean isEmpty()
Returns true if this map is empty, false otherwise.


iterator

java.util.Iterator<IColumn> iterator(ColumnSlice[] slices)
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.


reverseIterator

java.util.Iterator<IColumn> reverseIterator(ColumnSlice[] slices)
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.


isInsertReversed

boolean isInsertReversed()
Returns if this map only support inserts in reverse order.



Copyright © 2013 The Apache Software Foundation