public interface Index extends AutoCloseable
Modifier and Type | Field and Description |
---|---|
static SearchLimit |
NO_SEARCH_LIMIT |
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
|
MemoryAware |
getMemoryManager()
This is the memory manager of the index, this is used to determine vital memory parameters.
|
String |
getName() |
int |
getPageSize() |
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
|
IndexScanReport |
scan(ScanIntent intent,
Iterator<IndexableItem> scanItems)
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.
|
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.
|
static final SearchLimit NO_SEARCH_LIMIT
void configure(Configuration configuration) throws ConfigurationException
configuration
- The configuration objectConfigurationException
- If unable to configure the indexKeyInfo getKeyInfo()
String getName()
int getPageSize()
int getIndexType()
long count()
boolean hasUniqueConstraint()
int match(Set<String> fields)
fields
- The fields being requestedIndexSearchResultIteratorCollection searchIndex(SearchCondition searchCondition, SearchLimit searchLimit) throws JasDBStorageException
searchCondition
- The searchcondition to apply to only this indexsearchLimit
- The searchlimit to apply whilst searchingJasDBStorageException
- If unable to complete the search in the indexIndexIterator getIndexIterator() throws JasDBStorageException
JasDBStorageException
- If unable to open the index iteratorvoid insertIntoIndex(Key key) throws JasDBStorageException
key
- The key to be persisted to the indexJasDBStorageException
- If unable to persist the key in the indexvoid removeFromIndex(Key key) throws JasDBStorageException
key
- The key to be removed from the indexJasDBStorageException
- If unable to remove the key from the indexvoid updateKey(Key oldKey, Key newKey) throws JasDBStorageException
oldKey
- The previous key present in the indexnewKey
- The new key value to be used insteadJasDBStorageException
- If unable to update the key in the indexvoid openIndex() throws JasDBStorageException
JasDBStorageException
void close() throws JasDBStorageException
close
in interface AutoCloseable
JasDBStorageException
- If unable to cleanly close the indexvoid removeIndex() throws JasDBStorageException
JasDBStorageException
- If unable to delete the indexvoid flushIndex() throws JasDBStorageException
JasDBStorageException
- If unable to flush the changesIndexScanReport scan(ScanIntent intent, Iterator<IndexableItem> scanItems) throws JasDBStorageException
intent
- The scanning intent, rescan or reportscanItems
- The list of items to scan for in the indexJasDBStorageException
- If unable to perform or complete index scanIndexState getState()
void rebuildIndex(Iterator<IndexableItem> indexableItems) throws JasDBStorageException
indexableItems
- The items to be indexedJasDBStorageException
- If unable to rebuild the indexMemoryAware getMemoryManager() throws JasDBStorageException
JasDBStorageException
Copyright © 2015. All rights reserved.