|
||||||||||
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.util.SortedSet<java.nio.ByteBuffer> |
getIndexedColumns()
|
java.util.Collection<ColumnFamilyStore> |
getIndexesBackedByCfs()
|
SecondaryIndex |
getIndexForColumn(java.nio.ByteBuffer column)
|
DecoratedKey<LocalToken> |
getIndexKeyFor(java.nio.ByteBuffer name,
java.nio.ByteBuffer value)
Returns the decoratedKey for a column value |
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 |
removeAllIndexes()
Remove all underlying index data |
void |
removeIndexedColumn(java.nio.ByteBuffer column)
Removes a existing index |
void |
renameIndexes(java.lang.String newCfName)
Rename all underlying index files |
java.util.List<Row> |
search(org.apache.cassandra.thrift.IndexClause clause,
AbstractBounds range,
IFilter dataFilter)
Performs a search across a number of column indexes TODO: add support for querying across index types |
void |
unregisterMBeans()
Remove all index MBeans |
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
java.io.IOException
public java.util.SortedSet<java.nio.ByteBuffer> getIndexedColumns()
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 unregisterMBeans()
public void removeAllIndexes() throws java.io.IOException
java.io.IOException
public void renameIndexes(java.lang.String newCfName) throws java.io.IOException
newCfName
- the new index Name
java.io.IOException
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.util.Collection<ColumnFamilyStore> getIndexesBackedByCfs()
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(org.apache.cassandra.thrift.IndexClause clause, AbstractBounds range, IFilter dataFilter)
clause
- the index query clauserange
- the row range to restrict todataFilter
- the column range to restrict to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |