public abstract class BaseArrayIndex extends BaseIndex implements Index
indicesthat maintain an in-memory,
sorted array of key values (and their associated row identifiers). This type of index
is fast to read, relatively slow to write and somewhat memory expensive when very
large.| Constructor and Description |
|---|
BaseArrayIndex(java.lang.String name,
Column column,
boolean unique) |
BaseArrayIndex(java.lang.String name,
Column column,
boolean unique,
org.apache.commons.collections.primitives.IntList values) |
| Modifier and Type | Method and Description |
|---|---|
void |
changeRowId(Table table,
Row row,
int oldId,
int newId) |
protected abstract int |
find(java.lang.Object value,
boolean required) |
abstract IndexLoader |
getIndexLoader() |
RowIterator |
getInorderRowIterator(RowSource source)
Returns a
RowIteratorwhich is inorder traversal of keys, |
abstract java.util.List |
getKeyList() |
protected abstract java.util.List |
getKeyList(int minIndex,
int maxIndex) |
RowIterator |
getRowIterator(RowSource source,
Function fn,
java.lang.Object value)
Returns a
RowIteratorover the indexed rows, limited by the given
ComparisonOperator/value pair, using the default sort order. |
java.lang.String |
getType()
Returns my type.
|
protected org.apache.commons.collections.primitives.IntList |
getValueList() |
protected abstract int |
insertKey(java.lang.Object value) |
protected abstract int |
removeKey(java.lang.Object value) |
protected abstract void |
removeKeyAt(int index) |
void |
rowDeleted(RowEvent event) |
void |
rowInserted(RowEvent event) |
void |
rowUpdated(RowEvent event) |
void |
save(java.io.File dataDirectory) |
void |
saveAfterTruncate(java.io.File dataDirectory) |
boolean |
supportsFunction(Function fn)
Returns true iff
#getRowIterator(org.axiondb.RowSource,org.axiondb.ComparisonOperator,java.lang.Object)
can support the given operator, false otherwise. |
void |
truncate() |
getComparator, getDataType, getIndexedColumn, getName, isUniquecolumnAdded, constraintAdded, constraintRemovedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIndexedColumn, getName, isUniquecolumnAdded, constraintAdded, constraintRemovedpublic BaseArrayIndex(java.lang.String name,
Column column,
boolean unique)
public BaseArrayIndex(java.lang.String name,
Column column,
boolean unique,
org.apache.commons.collections.primitives.IntList values)
public void changeRowId(Table table, Row row, int oldId, int newId) throws AxionException
changeRowId in interface IndexAxionExceptionpublic abstract IndexLoader getIndexLoader()
getIndexLoader in interface IndexgetIndexLoader in class BaseIndexpublic RowIterator getInorderRowIterator(RowSource source) throws AxionException
IndexRowIteratorwhich is inorder traversal of keys,getInorderRowIterator in interface IndexgetInorderRowIterator in class BaseIndexsource - table/view for which we need to get inorder traversalAxionExceptionpublic abstract java.util.List getKeyList()
public RowIterator getRowIterator(RowSource source, Function fn, java.lang.Object value) throws AxionException
IndexRowIteratorover the indexed rows, limited by the given
ComparisonOperator/value pair, using the default sort order.getRowIterator in interface IndexgetRowIterator in class BaseIndexvalue - the value to compare the indexed column toAxionExceptionpublic java.lang.String getType()
Indexpublic void rowDeleted(RowEvent event) throws AxionException
rowDeleted in interface TableModificationListenerrowDeleted in class BaseTableModificationListenerAxionExceptionpublic void rowInserted(RowEvent event) throws AxionException
rowInserted in interface TableModificationListenerrowInserted in class BaseTableModificationListenerAxionExceptionpublic void rowUpdated(RowEvent event) throws AxionException
rowUpdated in interface TableModificationListenerrowUpdated in class BaseTableModificationListenerAxionExceptionpublic void save(java.io.File dataDirectory)
throws AxionException
save in interface Indexsave in class BaseIndexAxionExceptionpublic void saveAfterTruncate(java.io.File dataDirectory)
throws AxionException
saveAfterTruncate in interface IndexsaveAfterTruncate in class BaseIndexAxionExceptionpublic boolean supportsFunction(Function fn)
Index#getRowIterator(org.axiondb.RowSource,org.axiondb.ComparisonOperator,java.lang.Object)
can support the given operator, false otherwise.supportsFunction in interface IndexsupportsFunction in class BaseIndexpublic void truncate()
throws AxionException
truncate in interface Indextruncate in class BaseIndexAxionExceptionprotected abstract int find(java.lang.Object value,
boolean required)
protected abstract java.util.List getKeyList(int minIndex,
int maxIndex)
protected org.apache.commons.collections.primitives.IntList getValueList()
protected abstract int insertKey(java.lang.Object value)
throws AxionException
AxionExceptionprotected abstract int removeKey(java.lang.Object value)
throws AxionException
AxionExceptionprotected abstract void removeKeyAt(int index)
throws AxionException
AxionException