public class BTreeIndex extends Object implements Index
NO_SEARCH_LIMIT| Constructor and Description |
|---|
BTreeIndex(File indexLocation,
KeyInfo keyInfo) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the index and all its used resources
|
void |
configure(Configuration configuration)
Configure the index with configuration settings found in global configuration
|
long |
count()
Returns the amount of keys in the index
|
void |
flushIndex()
This persists the changes to the disk backing of the index
|
IndexIterator |
getIndexIterator()
This gets an iterator which allows iterating over the full index collection
|
int |
getIndexType() |
KeyInfo |
getKeyInfo()
This returns all global key information being stored in this index
|
protected LockManager |
getLockManager() |
MemoryAware |
getMemoryManager()
This is the memory manager of the index, this is used to determine vital memory parameters.
|
String |
getName() |
int |
getPageSize() |
protected BlockPersister |
getPersister() |
protected RootBlock |
getRootBlock() |
IndexState |
getState()
Returns the state of the index
|
boolean |
hasUniqueConstraint() |
void |
insertIntoIndex(Key key)
Inserts the given key into the index, the key is to expected to conform to the index key specification as determined
in the keyinfo.
|
int |
match(Set<String> fields)
Determines how close the gives fields match the index descriptor.
|
void |
openIndex()
Opens the index and its resources
|
void |
rebuildIndex(Iterator<IndexableItem> indexableItems)
Do a full rebuild of the index and fully populate it based on provided item iterator
|
void |
removeFromIndex(Key key)
Remove the given key and its values from the index.
|
void |
removeIndex()
Removes the index and all used resources
|
void |
resetIndex() |
IndexScanReport |
scan(ScanIntent intent,
Iterator<IndexableItem> indexableItems)
This performs a scan of the index and reports on the integrity.
|
IndexSearchResultIteratorCollection |
searchIndex(SearchCondition searchCondition,
SearchLimit searchLimit)
Do a search operation of the index given the searchcondition.
|
String |
toString() |
void |
updateKey(Key oldKey,
Key newKey)
Update the key payload inside the index, the key is to expected to conform to the index key specification as determined
in the keyinfo.
|
public void configure(Configuration configuration) throws ConfigurationException
Indexconfigure in interface Indexconfiguration - The configuration objectConfigurationException - If unable to configure the indexpublic boolean hasUniqueConstraint()
hasUniqueConstraint in interface Indexprotected RootBlock getRootBlock() throws JasDBStorageException
JasDBStorageExceptionprotected BlockPersister getPersister() throws JasDBStorageException
JasDBStorageExceptionprotected LockManager getLockManager() throws JasDBStorageException
JasDBStorageExceptionpublic KeyInfo getKeyInfo()
IndexgetKeyInfo in interface Indexpublic long count()
Indexpublic int getPageSize()
getPageSize in interface Indexpublic int getIndexType()
getIndexType in interface Indexpublic int match(Set<String> fields)
Indexpublic IndexSearchResultIteratorCollection searchIndex(SearchCondition searchCondition, SearchLimit searchLimit) throws JasDBStorageException
IndexsearchIndex in interface IndexsearchCondition - The searchcondition to apply to only this indexsearchLimit - The searchlimit to apply whilst searchingJasDBStorageException - If unable to complete the search in the indexpublic IndexIterator getIndexIterator() throws JasDBStorageException
IndexgetIndexIterator in interface IndexJasDBStorageException - If unable to open the index iteratorpublic void insertIntoIndex(Key key) throws JasDBStorageException
IndexinsertIntoIndex in interface Indexkey - The key to be persisted to the indexJasDBStorageException - If unable to persist the key in the indexpublic void removeFromIndex(Key key) throws JasDBStorageException
IndexremoveFromIndex in interface Indexkey - The key to be removed from the indexJasDBStorageException - If unable to remove the key from the indexpublic void updateKey(Key oldKey, Key newKey) throws JasDBStorageException
IndexupdateKey in interface IndexoldKey - The previous key present in the indexnewKey - The new key value to be used insteadJasDBStorageException - If unable to update the key in the indexpublic void openIndex()
throws JasDBStorageException
IndexopenIndex in interface IndexJasDBStorageExceptionpublic void close()
throws JasDBStorageException
Indexclose in interface AutoCloseableclose in interface IndexJasDBStorageException - If unable to cleanly close the indexpublic void removeIndex()
throws JasDBStorageException
IndexremoveIndex in interface IndexJasDBStorageException - If unable to delete the indexpublic void flushIndex()
throws JasDBStorageException
IndexflushIndex in interface IndexJasDBStorageException - If unable to flush the changespublic IndexScanReport scan(ScanIntent intent, Iterator<IndexableItem> indexableItems) throws JasDBStorageException
Indexscan in interface Indexintent - The scanning intent, rescan or reportindexableItems - The list of items to scan for in the indexJasDBStorageException - If unable to perform or complete index scanpublic void rebuildIndex(Iterator<IndexableItem> indexableItems) throws JasDBStorageException
IndexrebuildIndex in interface IndexindexableItems - The items to be indexedJasDBStorageException - If unable to rebuild the indexpublic void resetIndex()
throws JasDBStorageException
JasDBStorageExceptionpublic MemoryAware getMemoryManager() throws JasDBStorageException
IndexgetMemoryManager in interface IndexJasDBStorageExceptionpublic IndexState getState()
IndexCopyright © 2015. All rights reserved.