Interface OIndexManager

All Known Implementing Classes:
OSessionIndexManager

public interface OIndexManager
Manager of indexes.
Author:
Luca Garulli (l.garulli--(at)--orientdb.com)
  • Method Details

    • recreateIndexes

      @Deprecated void recreateIndexes()
      Deprecated.
      Manual indexes are deprecated and will be removed
      Drops all indexes and creates them from scratch.
    • getIndexes

      @Deprecated Collection<? extends OIndex> getIndexes()
      Deprecated.
      Manual indexes are deprecated and will be removed
      Returns all indexes registered in database.
      Returns:
      list of registered indexes.
    • getIndex

      OIndex getIndex(String iName)
      Index by specified name.
      Parameters:
      iName - name of index
      Returns:
      index if one registered in database or null otherwise.
    • getClassAutoShardingIndex

      @Deprecated OIndex getClassAutoShardingIndex(String className)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Returns the auto-sharding index defined for the class, if any.
      Parameters:
      className - Class name
    • existsIndex

      @Deprecated boolean existsIndex(String iName)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Checks if index with specified name exists in database.
      Parameters:
      iName - name of index.
      Returns:
      true if index with specified name exists, false otherwise.
    • createIndex

      @Deprecated OIndex createIndex(String iName, String iType, OIndexDefinition indexDefinition, int[] clusterIdsToIndex, OProgressListener progressListener, ODocument metadata)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Creates a new index with default algorithm.
      Parameters:
      iName - - name of index
      iType - - index type. Specified by plugged index factories.
      indexDefinition - metadata that describes index structure
      clusterIdsToIndex - ids of clusters that index should track for changes.
      progressListener - listener to track task progress.
      metadata - document with additional properties that can be used by index engine.
      Returns:
      a newly created index instance
    • createIndex

      @Deprecated OIndex createIndex(String iName, String iType, OIndexDefinition indexDefinition, int[] clusterIdsToIndex, OProgressListener progressListener, ODocument metadata, String algorithm)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Creates a new index.

      May require quite a long time if big amount of data should be indexed.

      Parameters:
      iName - name of index
      iType - index type. Specified by plugged index factories.
      indexDefinition - metadata that describes index structure
      clusterIdsToIndex - ids of clusters that index should track for changes.
      progressListener - listener to track task progress.
      metadata - document with additional properties that can be used by index engine.
      algorithm - tip to an index factory what algorithm to use
      Returns:
      a newly created index instance
    • dropIndex

      @Deprecated OIndexManager dropIndex(String iIndexName)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Drop index with specified name. Do nothing if such index does not exists.
      Parameters:
      iIndexName - the name of index to drop
      Returns:
      this
    • getDefaultClusterName

      @Deprecated String getDefaultClusterName()
      Deprecated.
      IMPORTANT! Only for internal usage.
      Returns:
      name of default cluster.
    • setDefaultClusterName

      @Deprecated void setDefaultClusterName(String defaultClusterName)
      Deprecated.
      Sets the new default cluster.

      IMPORTANT! Only for internal usage.

      Parameters:
      defaultClusterName - name of new default cluster
    • getDictionary

      @Deprecated ODictionary<ORecord> getDictionary()
      Deprecated.
      Manual indexes are deprecated and will be removed
      Return a dictionary index. Could be helpful to store different kinds of configurations.
      Returns:
      a dictionary
    • getConfiguration

      @Deprecated ODocument getConfiguration()
      Deprecated.
      Returns a record where configurations are saved.

      IMPORTANT! Only for internal usage.

      Returns:
      a document that used to store index configurations.
    • getClassInvolvedIndexes

      @Deprecated Set<OIndex> getClassInvolvedIndexes(String className, Collection<String> fields)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Returns list of indexes that contain passed in fields names as their first keys. Order of fields does not matter.

      All indexes sorted by their count of parameters in ascending order. If there are indexes for the given set of fields in super class they will be taken into account.

      Parameters:
      className - name of class which is indexed.
      fields - Field names.
      Returns:
      list of indexes that contain passed in fields names as their first keys.
    • getClassInvolvedIndexes

      @Deprecated Set<OIndex> getClassInvolvedIndexes(String className, String... fields)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Returns list of indexes that contain passed in fields names as their first keys. Order of fields does not matter.

      All indexes sorted by their count of parameters in ascending order. If there are indexes for the given set of fields in super class they will be taken into account.

      Parameters:
      className - name of class which is indexed.
      fields - Field names.
      Returns:
      list of indexes that contain passed in fields names as their first keys.
    • areIndexed

      @Deprecated boolean areIndexed(String className, Collection<String> fields)
      Deprecated.
      Indicates whether given fields are contained as first key fields in class indexes. Order of fields does not matter. If there are indexes for the given set of fields in super class they will be taken into account.
      Parameters:
      className - name of class which contain fields.
      fields - Field names.
      Returns:
      true if given fields are contained as first key fields in class indexes.
    • areIndexed

      @Deprecated boolean areIndexed(String className, String... fields)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Parameters:
      className - name of class which contain fields.
      fields - Field names.
      Returns:
      true if given fields are contained as first key fields in class indexes.
      See Also:
    • getClassIndexes

      @Deprecated Set<OIndex> getClassIndexes(String className)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Gets indexes for a specified class (excluding indexes for sub-classes).
      Parameters:
      className - name of class which is indexed.
      Returns:
      a set of indexes related to specified class
    • getClassIndexes

      @Deprecated void getClassIndexes(String className, Collection<OIndex> indexes)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Gets indexes for a specified class (excluding indexes for sub-classes).
      Parameters:
      className - name of class which is indexed.
      indexes - Collection of indexes where to add all the indexes
    • getClassUniqueIndex

      @Deprecated OIndexUnique getClassUniqueIndex(String className)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Returns the unique index for a class, if any.
    • getClassIndex

      @Deprecated OIndex getClassIndex(String className, String indexName)
      Deprecated.
      Manual indexes are deprecated and will be removed
      Searches for index for a specified class with specified name.
      Parameters:
      className - name of class which is indexed.
      indexName - name of index.
      Returns:
      an index instance or null if such does not exist.
    • waitTillIndexRestore

      @Deprecated void waitTillIndexRestore()
      Deprecated.
      Manual indexes are deprecated and will be removed
      Blocks current thread till indexes will be restored.
    • autoRecreateIndexesAfterCrash

      @Deprecated boolean autoRecreateIndexesAfterCrash()
      Deprecated.
      Checks if indexes should be automatically recreated.

      IMPORTANT! Only for internal usage.

      Returns:
      true if crash is happened and database configured to automatically recreate indexes after crash.
    • addClusterToIndex

      void addClusterToIndex(String clusterName, String indexName)
      Adds a cluster to tracked cluster list of specified index.

      IMPORTANT! Only for internal usage.

      Parameters:
      clusterName - cluster to add.
      indexName - name of index.
    • removeClusterFromIndex

      void removeClusterFromIndex(String clusterName, String indexName)
      Removes a cluster from tracked cluster list of specified index.

      IMPORTANT! Only for internal usage.

      Parameters:
      clusterName - cluster to remove.
      indexName - name of index.
    • removeClassPropertyIndex

      @Deprecated void removeClassPropertyIndex(OIndex idx)
      Deprecated.
      Removes index from class-property map.

      IMPORTANT! Only for internal usage.

      Parameters:
      idx - index to remove.