Interface OIndex
- All Superinterfaces:
Comparable<OIndex>
- All Known Subinterfaces:
OIndexInternal
- All Known Implementing Classes:
OIndexAbstract,OIndexDictionary,OIndexFullText,OIndexMultiValues,OIndexNotUnique,OIndexOneValue,OIndexRemote,OIndexRemoteMultiValue,OIndexRemoteOneValue,OIndexUnique,OLuceneFullTextIndex,OLuceneIndexNotUnique,OLuceneSpatialIndex
Basic interface to handle index.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
-
Method Summary
Modifier and TypeMethodDescriptionclear()Deprecated.Manual indexes are deprecated and will be removedlongDeprecated.Useindex.getInternal().getRids(key).count()instead.cursor()Deprecated.Useindex.getInternal().stream()instead.delete()Delete the index.Deprecated.Useindex.getInternal().descStream()instead.voidflush()Deprecated.Deprecated.UseOIndexInternal.getRids(Object)instead, but only as internal (not public) API.Returns the engine of the index as string.Returns Names of clusters that will be indexed.Returns the index configuration.Deprecated.Useindex.getInternal().stream().findFirst().map(pair->pair.first)instead.Returns the internal index used.longDeprecated.Useindex.getInternal().getRids(key).distinct().count()instead.OType[]Types of the keys that index can accept, if index contains composite key, list of types of elements from which this index consist will be returned, otherwise single element (key type obviously) will be returned.Deprecated.Useindex.getInternal().descStream().findFirst().map(pair->pair.first)instead.getName()Returns the index name.longDeprecated.longgetSize()Deprecated.UseOIndexInternal.size()instead.getType()Returns the type of the index as string.intReturns binary format version for this index.booleanTells if the index is automatic.booleanDeprecated.booleanisUnique()iterateEntries(Collection<?> keys, boolean ascSortOrder) Deprecated.UseOIndexInternal.streamEntries(Collection, boolean)instead.iterateEntriesBetween(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive, boolean ascOrder) Deprecated.iterateEntriesMajor(Object fromKey, boolean fromInclusive, boolean ascOrder) Deprecated.iterateEntriesMinor(Object toKey, boolean toInclusive, boolean ascOrder) Deprecated.Deprecated.Useindex.getInternal().keyStream()instead.put(Object key, OIdentifiable value) Inserts a new entry in the index.longrebuild()Rebuilds an automatic index.longrebuild(OProgressListener iProgressListener) Populate the index with all the existent records.booleanRemoves an entry by its key.booleanremove(Object key, OIdentifiable rid) Removes an entry by its key and value.booleanMethods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getDatabaseName
String getDatabaseName() -
getKeyTypes
OType[] getKeyTypes()Types of the keys that index can accept, if index contains composite key, list of types of elements from which this index consist will be returned, otherwise single element (key type obviously) will be returned. -
get
Deprecated.UseOIndexInternal.getRids(Object)instead, but only as internal (not public) API.Gets the set of records associated with the passed key.- Parameters:
key- The key to search- Returns:
- The Record set if found, otherwise an empty Set
-
put
Inserts a new entry in the index. The behaviour depends by the index implementation.- Parameters:
key- Entry's keyvalue- Entry's value as OIdentifiable instance- Returns:
- The index instance itself to allow in chain calls
-
remove
Removes an entry by its key.- Parameters:
key- The entry's key to remove- Returns:
- True if the entry has been found and removed, otherwise false
-
remove
Removes an entry by its key and value.- Parameters:
key- The entry's key to remove- Returns:
- True if the entry has been found and removed, otherwise false
-
clear
Deprecated.Manual indexes are deprecated and will be removedClears the index removing all the entries in one shot.- Returns:
- The index instance itself to allow in chain calls
-
getSize
Deprecated.UseOIndexInternal.size()instead. This API only for internal use !.- Returns:
- number of entries in the index.
-
count
Deprecated.Useindex.getInternal().getRids(key).count()instead. This API only for internal use !.Counts the entries for the key. -
getKeySize
Deprecated.Useindex.getInternal().getRids(key).distinct().count()instead. This API only for internal use !.- Returns:
- Number of keys in index
-
flush
Deprecated.Flushes in-memory changes to disk. -
getRebuildVersion
Deprecated. -
isRebuilding
Deprecated.- Returns:
- Indicates whether index is rebuilding at the moment.
- See Also:
-
getFirstKey
Deprecated.Useindex.getInternal().stream().findFirst().map(pair->pair.first)instead. This API only for internal use ! -
getLastKey
Deprecated.Useindex.getInternal().descStream().findFirst().map(pair->pair.first)instead. This API only for internal use ! -
cursor
Deprecated.Useindex.getInternal().stream()instead. This API only for internal use ! -
descCursor
Deprecated.Useindex.getInternal().descStream()instead. This API only for internal use ! -
keyCursor
Deprecated.Useindex.getInternal().keyStream()instead. This API only for internal use ! -
delete
OIndex delete()Delete the index.- Returns:
- The index instance itself to allow in chain calls
-
getName
String getName()Returns the index name.- Returns:
- The name of the index
-
getType
String getType()Returns the type of the index as string. -
getAlgorithm
String getAlgorithm()Returns the engine of the index as string. -
getVersion
int getVersion()Returns binary format version for this index. Index format changes during system development but old formats are supported for binary compatibility. This method may be used to detect version of binary format which is used by current index and upgrade index to new one.- Returns:
- Returns binary format version for this index if possible, otherwise -1.
-
isAutomatic
boolean isAutomatic()Tells if the index is automatic. Automatic means it's maintained automatically by OrientDB. This is the case of indexes created against schema properties. Automatic indexes can always been rebuilt.- Returns:
- True if the index is automatic, otherwise false
-
rebuild
long rebuild()Rebuilds an automatic index.- Returns:
- The number of entries rebuilt
-
rebuild
Populate the index with all the existent records. -
getConfiguration
ODocument getConfiguration()Returns the index configuration.- Returns:
- An ODocument object containing all the index properties
-
getInternal
OIndexInternal getInternal()Returns the internal index used. -
getDefinition
OIndexDefinition getDefinition() -
getClusters
Returns Names of clusters that will be indexed.- Returns:
- Names of clusters that will be indexed.
-
iterateEntries
Deprecated.UseOIndexInternal.streamEntries(Collection, boolean)instead. This API only for internal use !Returns cursor which presents data associated with passed in keys.- Parameters:
keys- Keys data of which should be returned.ascSortOrder- Flag which determines whether data iterated by cursor should be in ascending or descending order.- Returns:
- cursor which presents data associated with passed in keys.
-
iterateEntriesBetween
@Deprecated OIndexCursor iterateEntriesBetween(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive, boolean ascOrder) Deprecated.UseOIndexInternal.streamEntriesBetween(Object, boolean, Object, boolean, boolean)instead. This API only * for internal use !Returns cursor which presents subset of index data between passed in keys.- Parameters:
fromKey- Lower border of index data.fromInclusive- Indicates whether lower border should be inclusive or exclusive.toKey- Upper border of index data.toInclusive- Indicates whether upper border should be inclusive or exclusive.ascOrder- Flag which determines whether data iterated by cursor should be in ascending or descending order.- Returns:
- Cursor which presents subset of index data between passed in keys.
-
iterateEntriesMajor
@Deprecated OIndexCursor iterateEntriesMajor(Object fromKey, boolean fromInclusive, boolean ascOrder) Deprecated.UseOIndexInternal.streamEntriesMajor(Object, boolean, boolean)instead. This API only for internal use !Returns cursor which presents subset of data which associated with key which is greater than passed in key.- Parameters:
fromKey- Lower border of index data.fromInclusive- Indicates whether lower border should be inclusive or exclusive.ascOrder- Flag which determines whether data iterated by cursor should be in ascending or descending order.- Returns:
- cursor which presents subset of data which associated with key which is greater than passed in key.
-
iterateEntriesMinor
Deprecated.UseOIndexInternal.streamEntriesMinor(Object, boolean, boolean)instead. This API only for internal use !Returns cursor which presents subset of data which associated with key which is less than passed in key.- Parameters:
toKey- Upper border of index data.toInclusive- Indicates Indicates whether upper border should be inclusive or exclusive.ascOrder- Flag which determines whether data iterated by cursor should be in ascending or descending order.- Returns:
- cursor which presents subset of data which associated with key which is less than passed in key.
-
getMetadata
ODocument getMetadata() -
supportsOrderedIterations
boolean supportsOrderedIterations() -
isUnique
boolean isUnique()
-