Interface OIndexInternal

All Superinterfaces:
Comparable<OIndex>, OIndex
All Known Implementing Classes:
OIndexAbstract, OIndexDictionary, OIndexFullText, OIndexMultiValues, OIndexNotUnique, OIndexOneValue, OIndexUnique, OLuceneFullTextIndex, OLuceneIndexNotUnique, OLuceneSpatialIndex

public interface OIndexInternal extends OIndex
Interface to handle index.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Field Details

  • Method Details

    • getCollatingValue

      Object getCollatingValue(Object key)
    • loadFromConfiguration

      boolean loadFromConfiguration(ODocument iConfig)
      Loads the index giving the configuration.
      Parameters:
      iConfig - ODocument instance containing the configuration
    • updateConfiguration

      ODocument updateConfiguration()
      Saves the index configuration to disk.
      Returns:
      The configuration as ODocument instance
      See Also:
    • addCluster

      OIndex addCluster(String iClusterName)
      Add given cluster to the list of clusters that should be automatically indexed.
      Parameters:
      iClusterName - Cluster to add.
      Returns:
      Current index instance.
    • removeCluster

      OIndex removeCluster(String iClusterName)
      Remove given cluster from the list of clusters that should be automatically indexed.
      Parameters:
      iClusterName - Cluster to remove.
      Returns:
      Current index instance.
    • canBeUsedInEqualityOperators

      boolean canBeUsedInEqualityOperators()
    • hasRangeQuerySupport

      boolean hasRangeQuerySupport()
    • loadMetadata

      OIndexMetadata loadMetadata(ODocument iConfig)
    • close

      void close()
    • getIndexNameByKey

      String getIndexNameByKey(Object key)
      Returns the index name for a key. The name is always the current index name, but in cases where the index supports key-based sharding.
      Parameters:
      key - the index key.
      Returns:
      The index name involved
    • acquireAtomicExclusiveLock

      boolean acquireAtomicExclusiveLock(Object key)
      Acquires exclusive lock in the active atomic operation running on the current thread for this index.

      If this index supports a more narrow locking, for example key-based sharding, it may use the provided key to infer a more narrow lock scope, but that is not a requirement.

      Parameters:
      key - the index key to lock.
      Returns:
      true if this index was locked entirely, false if this index locking is sensitive to the provided key and only some subset of this index was locked.
    • size

      long size()
      Returns:
      number of entries in the index.
    • getRids

      Stream<ORID> getRids(Object key)
    • stream

    • descStream

      Stream<ORawPair<Object,ORID>> descStream()
    • keyStream

      Stream<Object> keyStream()
    • streamEntriesBetween

      Stream<ORawPair<Object,ORID>> streamEntriesBetween(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive, boolean ascOrder)
      Returns stream 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 stream should be in ascending or descending order.
      Returns:
      Cursor which presents subset of index data between passed in keys.
    • streamEntries

      Stream<ORawPair<Object,ORID>> streamEntries(Collection<?> keys, boolean ascSortOrder)
      Returns stream 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 stream should be in ascending or descending order.
      Returns:
      stream which presents data associated with passed in keys.
    • streamEntriesMajor

      Stream<ORawPair<Object,ORID>> streamEntriesMajor(Object fromKey, boolean fromInclusive, boolean ascOrder)
      Returns stream 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 stream should be in ascending or descending order.
      Returns:
      stream which presents subset of data which associated with key which is greater than passed in key.
    • streamEntriesMinor

      Stream<ORawPair<Object,ORID>> streamEntriesMinor(Object toKey, boolean toInclusive, boolean ascOrder)
      Returns stream 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 stream should be in ascending or descending order.
      Returns:
      stream which presents subset of data which associated with key which is less than passed in key.
    • securityFilterOnRead

      static OIdentifiable securityFilterOnRead(OIndex idx, OIdentifiable item)
    • isLabelSecurityDefined

      static boolean isLabelSecurityDefined(ODatabaseDocumentInternal database, OSecurityInternal security, String indexClass, String propertyName)
    • isReadRestrictedBySecurityPolicy

      static boolean isReadRestrictedBySecurityPolicy(String indexClass, ODatabaseDocumentInternal db, OSecurityInternal security)
    • securityFilterOnRead

      static Collection securityFilterOnRead(OIndex idx, Collection<OIdentifiable> items)
    • isNativeTxSupported

      boolean isNativeTxSupported()
    • interpretTxKeyChanges

    • getRidsIgnoreTx

      Stream<ORID> getRidsIgnoreTx(Object key)
    • create

      OIndex create(OIndexMetadata metadata, boolean rebuild, OProgressListener progressListener)
    • getIndexId

      int getIndexId()