|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.db.index.SecondaryIndexManager
public class SecondaryIndexManager
Manages all the indexes associated with a given CFS Different types of indexes can be created across the same CF
Field Summary | |
---|---|
ColumnFamilyStore |
baseCfs
The underlying column family containing the source data for these indexes |
Constructor Summary | |
---|---|
SecondaryIndexManager(ColumnFamilyStore baseCfs)
|
Method Summary | |
---|---|
java.util.concurrent.Future<?> |
addIndexedColumn(ColumnDefinition cdef)
Adds and builds a index for a column |
void |
applyIndexUpdates(java.nio.ByteBuffer rowKey,
ColumnFamily cf,
java.util.SortedSet<java.nio.ByteBuffer> mutatedIndexedColumns,
ColumnFamily oldIndexedColumns)
Removes obsolete index entries and creates new ones for the given row key and mutated columns. |
void |
deleteFromIndexes(DecoratedKey<?> key,
java.util.List<IColumn> indexedColumnsInRow)
Delete all columns from all indexes for this row |
void |
flushIndexesBlocking()
Flush all indexes to disk |
java.util.List<java.lang.String> |
getBuiltIndexes()
|
java.nio.ByteBuffer |
getColumnByIdxName(java.lang.String idxName)
|
java.util.SortedSet<java.nio.ByteBuffer> |
getIndexedColumns()
|
java.util.Collection<SecondaryIndex> |
getIndexes()
|
java.util.Collection<ColumnFamilyStore> |
getIndexesBackedByCfs()
|
java.util.Collection<SecondaryIndex> |
getIndexesNotBackedByCfs()
|
SecondaryIndex |
getIndexForColumn(java.nio.ByteBuffer column)
|
DecoratedKey<LocalToken> |
getIndexKeyFor(java.nio.ByteBuffer name,
java.nio.ByteBuffer value)
Returns the decoratedKey for a column value |
long |
getTotalLiveSize()
|
boolean |
hasIndexFor(java.util.List<org.apache.cassandra.thrift.IndexExpression> clause)
|
void |
invalidate()
Remove the index |
void |
maybeBuildSecondaryIndexes(java.util.Collection<SSTableReader> sstables,
java.util.SortedSet<java.nio.ByteBuffer> columns)
Does a full, blocking rebuild of the indexes specified by columns from the sstables. |
void |
reload()
Drops and adds new indexes associated with the underlying CF |
void |
removeIndexedColumn(java.nio.ByteBuffer column)
Removes a existing index |
java.util.List<Row> |
search(java.util.List<org.apache.cassandra.thrift.IndexExpression> clause,
AbstractBounds<RowPosition> range,
int maxResults,
IFilter dataFilter,
boolean maxIsColumns)
Performs a search across a number of column indexes TODO: add support for querying across index types |
void |
setIndexBuilt(java.util.Collection<java.nio.ByteBuffer> indexes)
|
void |
setIndexRemoved(java.util.Collection<java.nio.ByteBuffer> indexes)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final ColumnFamilyStore baseCfs
Constructor Detail |
---|
public SecondaryIndexManager(ColumnFamilyStore baseCfs)
Method Detail |
---|
public void reload() throws java.io.IOException
java.io.IOException
public void maybeBuildSecondaryIndexes(java.util.Collection<SSTableReader> sstables, java.util.SortedSet<java.nio.ByteBuffer> columns) throws java.io.IOException
sstables
- the data to build fromcolumns
- the list of columns to index, ordered by comparator
java.io.IOException
public java.util.SortedSet<java.nio.ByteBuffer> getIndexedColumns()
public boolean hasIndexFor(java.util.List<org.apache.cassandra.thrift.IndexExpression> clause)
public void removeIndexedColumn(java.nio.ByteBuffer column) throws java.io.IOException
column
- the indexed column to remove
java.io.IOException
public java.util.concurrent.Future<?> addIndexedColumn(ColumnDefinition cdef)
cdef
- the column definition holding the index data
public SecondaryIndex getIndexForColumn(java.nio.ByteBuffer column)
column
- the name of indexes column
public void invalidate()
public void flushIndexesBlocking() throws java.io.IOException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
java.io.IOException
public DecoratedKey<LocalToken> getIndexKeyFor(java.nio.ByteBuffer name, java.nio.ByteBuffer value)
name
- column namevalue
- column value
public java.util.List<java.lang.String> getBuiltIndexes()
public java.nio.ByteBuffer getColumnByIdxName(java.lang.String idxName)
public java.util.Collection<ColumnFamilyStore> getIndexesBackedByCfs()
public java.util.Collection<SecondaryIndex> getIndexesNotBackedByCfs()
public java.util.Collection<SecondaryIndex> getIndexes()
public long getTotalLiveSize()
public void applyIndexUpdates(java.nio.ByteBuffer rowKey, ColumnFamily cf, java.util.SortedSet<java.nio.ByteBuffer> mutatedIndexedColumns, ColumnFamily oldIndexedColumns) throws java.io.IOException
rowKey
- the row keycf
- the current rows datamutatedIndexedColumns
- the set of columns that were changed or addedoldIndexedColumns
- the columns what were deleted
java.io.IOException
public void deleteFromIndexes(DecoratedKey<?> key, java.util.List<IColumn> indexedColumnsInRow) throws java.io.IOException
key
- the row keyindexedColumnsInRow
- all column names in row
java.io.IOException
public java.util.List<Row> search(java.util.List<org.apache.cassandra.thrift.IndexExpression> clause, AbstractBounds<RowPosition> range, int maxResults, IFilter dataFilter, boolean maxIsColumns)
clause
- the index query clauserange
- the row range to restrict todataFilter
- the column range to restrict to
public void setIndexBuilt(java.util.Collection<java.nio.ByteBuffer> indexes)
public void setIndexRemoved(java.util.Collection<java.nio.ByteBuffer> indexes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |