Class OIndexRemote

java.lang.Object
com.orientechnologies.orient.core.index.OIndexRemote
All Implemented Interfaces:
OIndex, Comparable<OIndex>
Direct Known Subclasses:
OIndexRemoteMultiValue, OIndexRemoteOneValue

public abstract class OIndexRemote extends Object implements OIndex
Proxied abstract index.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Field Details

  • Constructor Details

  • Method Details

    • create

      public OIndexRemote create(OIndexMetadata indexMetadata, boolean rebuild, OProgressListener progressListener)
    • delete

      public OIndexRemote delete()
      Description copied from interface: OIndex
      Delete the index.
      Specified by:
      delete in interface OIndex
      Returns:
      The index instance itself to allow in chain calls
    • getDatabaseName

      public String getDatabaseName()
      Specified by:
      getDatabaseName in interface OIndex
    • getRebuildVersion

      public long getRebuildVersion()
      Specified by:
      getRebuildVersion in interface OIndex
    • contains

      public boolean contains(Object iKey)
    • count

      public long count(Object iKey)
      Description copied from interface: OIndex
      Counts the entries for the key.
      Specified by:
      count in interface OIndex
    • count

      public long count(Object iRangeFrom, boolean iFromInclusive, Object iRangeTo, boolean iToInclusive, int maxValuesToFetch)
    • put

      public OIndexRemote put(Object key, OIdentifiable value)
      Description copied from interface: OIndex
      Inserts a new entry in the index. The behaviour depends by the index implementation.
      Specified by:
      put in interface OIndex
      Parameters:
      key - Entry's key
      value - Entry's value as OIdentifiable instance
      Returns:
      The index instance itself to allow in chain calls
    • remove

      public boolean remove(Object key)
      Description copied from interface: OIndex
      Removes an entry by its key.
      Specified by:
      remove in interface OIndex
      Parameters:
      key - The entry's key to remove
      Returns:
      True if the entry has been found and removed, otherwise false
    • remove

      public boolean remove(Object key, OIdentifiable rid)
      Description copied from interface: OIndex
      Removes an entry by its key and value.
      Specified by:
      remove in interface OIndex
      Parameters:
      key - The entry's key to remove
      Returns:
      True if the entry has been found and removed, otherwise false
    • getVersion

      public int getVersion()
      Description copied from interface: OIndex
      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.
      Specified by:
      getVersion in interface OIndex
      Returns:
      Returns binary format version for this index if possible, otherwise -1.
    • automaticRebuild

      public void automaticRebuild()
    • rebuild

      public long rebuild()
      Description copied from interface: OIndex
      Rebuilds an automatic index.
      Specified by:
      rebuild in interface OIndex
      Returns:
      The number of entries rebuilt
    • clear

      public OIndexRemote clear()
      Description copied from interface: OIndex
      Clears the index removing all the entries in one shot.
      Specified by:
      clear in interface OIndex
      Returns:
      The index instance itself to allow in chain calls
    • getSize

      public long getSize()
      Specified by:
      getSize in interface OIndex
      Returns:
      number of entries in the index.
    • getKeySize

      public long getKeySize()
      Specified by:
      getKeySize in interface OIndex
      Returns:
      Number of keys in index
    • isAutomatic

      public boolean isAutomatic()
      Description copied from interface: OIndex
      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.
      Specified by:
      isAutomatic in interface OIndex
      Returns:
      True if the index is automatic, otherwise false
    • isUnique

      public boolean isUnique()
      Specified by:
      isUnique in interface OIndex
    • getName

      public String getName()
      Description copied from interface: OIndex
      Returns the index name.
      Specified by:
      getName in interface OIndex
      Returns:
      The name of the index
    • flush

      public void flush()
      Description copied from interface: OIndex
      Flushes in-memory changes to disk.
      Specified by:
      flush in interface OIndex
    • getType

      public String getType()
      Description copied from interface: OIndex
      Returns the type of the index as string.
      Specified by:
      getType in interface OIndex
    • getAlgorithm

      public String getAlgorithm()
      Description copied from interface: OIndex
      Returns the engine of the index as string.
      Specified by:
      getAlgorithm in interface OIndex
    • getConfiguration

      public ODocument getConfiguration()
      Description copied from interface: OIndex
      Returns the index configuration.
      Specified by:
      getConfiguration in interface OIndex
      Returns:
      An ODocument object containing all the index properties
    • getMetadata

      public ODocument getMetadata()
      Specified by:
      getMetadata in interface OIndex
    • getIdentity

      public ORID getIdentity()
    • getInternal

      public OIndexInternal getInternal()
      Description copied from interface: OIndex
      Returns the internal index used.
      Specified by:
      getInternal in interface OIndex
    • rebuild

      public long rebuild(OProgressListener iProgressListener)
      Description copied from interface: OIndex
      Populate the index with all the existent records.
      Specified by:
      rebuild in interface OIndex
    • getKeyTypes

      public OType[] getKeyTypes()
      Description copied from interface: OIndex
      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.
      Specified by:
      getKeyTypes in interface OIndex
    • getEntries

      public Collection<ODocument> getEntries(Collection<?> iKeys)
    • getDefinition

      public OIndexDefinition getDefinition()
      Specified by:
      getDefinition in interface OIndex
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getClusters

      public Set<String> getClusters()
      Description copied from interface: OIndex
      Returns Names of clusters that will be indexed.
      Specified by:
      getClusters in interface OIndex
      Returns:
      Names of clusters that will be indexed.
    • isRebuilding

      public boolean isRebuilding()
      Specified by:
      isRebuilding in interface OIndex
      Returns:
      Indicates whether index is rebuilding at the moment.
      See Also:
    • getFirstKey

      public Object getFirstKey()
      Specified by:
      getFirstKey in interface OIndex
    • getLastKey

      public Object getLastKey()
      Specified by:
      getLastKey in interface OIndex
    • iterateEntriesBetween

      public OIndexCursor iterateEntriesBetween(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive, boolean ascOrder)
      Description copied from interface: OIndex
      Returns cursor which presents subset of index data between passed in keys.
      Specified by:
      iterateEntriesBetween in interface OIndex
      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

      public OIndexCursor iterateEntriesMajor(Object fromKey, boolean fromInclusive, boolean ascOrder)
      Description copied from interface: OIndex
      Returns cursor which presents subset of data which associated with key which is greater than passed in key.
      Specified by:
      iterateEntriesMajor in interface OIndex
      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

      public OIndexCursor iterateEntriesMinor(Object toKey, boolean toInclusive, boolean ascOrder)
      Description copied from interface: OIndex
      Returns cursor which presents subset of data which associated with key which is less than passed in key.
      Specified by:
      iterateEntriesMinor in interface OIndex
      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.
    • iterateEntries

      public OIndexCursor iterateEntries(Collection<?> keys, boolean ascSortOrder)
      Description copied from interface: OIndex
      Returns cursor which presents data associated with passed in keys.
      Specified by:
      iterateEntries in interface OIndex
      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.
    • cursor

      public OIndexCursor cursor()
      Specified by:
      cursor in interface OIndex
    • descCursor

      public OIndexCursor descCursor()
      Specified by:
      descCursor in interface OIndex
    • keyCursor

      public OIndexKeyCursor keyCursor()
      Specified by:
      keyCursor in interface OIndex
    • compareTo

      public int compareTo(OIndex index)
      Specified by:
      compareTo in interface Comparable<OIndex>
    • getDatabase

      protected ODatabaseDocumentInternal getDatabase()