|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.db.index.SecondaryIndex
public abstract class SecondaryIndex
Abstract base class for different types of secondary indexes. Do not extend this directly, please pick from PerColumnSecondaryIndex or PerRowSecondaryIndex
Field Summary | |
---|---|
protected ColumnFamilyStore |
baseCfs
Base CF that has many indexes |
protected java.util.Set<ColumnDefinition> |
columnDefs
The column definitions which this index is responsible for |
static java.lang.String |
CUSTOM_INDEX_OPTION_NAME
|
Constructor Summary | |
---|---|
SecondaryIndex()
|
Method Summary | |
---|---|
java.util.concurrent.Future<?> |
buildIndexAsync()
Builds the index using the data in the underlying CF, non blocking |
protected void |
buildIndexBlocking()
Builds the index using the data in the underlying CFS Blocks till it's complete |
static SecondaryIndex |
createInstance(ColumnFamilyStore baseCfs,
ColumnDefinition cdef)
This is the primary way to create a secondary index instance for a CF column. |
protected abstract SecondaryIndexSearcher |
createSecondaryIndexSearcher(java.util.Set<java.nio.ByteBuffer> columns)
Called at query time Creates a implementation specific searcher instance for this index type |
abstract void |
forceBlockingFlush()
Forces this indexes in memory data to disk |
ColumnFamilyStore |
getBaseCfs()
|
abstract ColumnFamilyStore |
getIndexCfs()
Allow access to the underlying column family store if there is one |
abstract java.lang.String |
getIndexName()
|
abstract long |
getLiveSize()
Get current amount of memory this index is consuming (in bytes) |
abstract java.lang.String |
getNameForSystemTable(java.nio.ByteBuffer columnName)
Return the unique name for this index and column to be stored in the SystemTable that tracks if each column is built |
abstract void |
init()
Perform any initialization work |
abstract void |
invalidate()
Remove the index and unregisters this index's mbean if one exists |
boolean |
isIndexBuilt(java.nio.ByteBuffer columnName)
Checks if the index for specified column is fully built |
abstract void |
removeIndex(java.nio.ByteBuffer columnName)
Delete all files and references to this index |
abstract void |
truncate(long truncatedAt)
Truncate all the data from the current index |
abstract void |
validateOptions()
Validates the index_options passed in the ColumnDef |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CUSTOM_INDEX_OPTION_NAME
protected ColumnFamilyStore baseCfs
protected java.util.Set<ColumnDefinition> columnDefs
Constructor Detail |
---|
public SecondaryIndex()
Method Detail |
---|
public abstract void init()
public abstract void validateOptions() throws ConfigurationException
ConfigurationException
public abstract java.lang.String getIndexName()
public abstract java.lang.String getNameForSystemTable(java.nio.ByteBuffer columnName)
columnName
- the name of the column
public boolean isIndexBuilt(java.nio.ByteBuffer columnName)
columnName
- the column
protected abstract SecondaryIndexSearcher createSecondaryIndexSearcher(java.util.Set<java.nio.ByteBuffer> columns)
columns
- the list of columns which belong to this index type
public abstract void forceBlockingFlush() throws java.io.IOException
java.io.IOException
public abstract long getLiveSize()
public abstract ColumnFamilyStore getIndexCfs()
public abstract void removeIndex(java.nio.ByteBuffer columnName) throws java.io.IOException
columnName
- the indexed column to remove
java.io.IOException
public abstract void invalidate()
public abstract void truncate(long truncatedAt)
truncatedAt
- The truncation timestamp, all data before that timestamp should be rejected.protected void buildIndexBlocking() throws java.io.IOException
java.io.IOException
public java.util.concurrent.Future<?> buildIndexAsync()
public ColumnFamilyStore getBaseCfs()
public static SecondaryIndex createInstance(ColumnFamilyStore baseCfs, ColumnDefinition cdef) throws ConfigurationException
baseCfs
- the source of data for the Indexcdef
- the meta information about this column (index_type, index_options, name, etc...)
ConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |