public class OIndexManagerProxy extends OProxedResource<OIndexManagerAbstract> implements OIndexManager
database, delegate
Constructor and Description |
---|
OIndexManagerProxy(OIndexManagerAbstract iDelegate,
ODatabaseDocumentInternal iDatabase) |
Modifier and Type | Method and Description |
---|---|
void |
addClusterToIndex(String clusterName,
String indexName)
Adds a cluster to tracked cluster list of specified index.
|
boolean |
areIndexed(String className,
Collection<String> fields)
Indicates whether given fields are contained as first key fields in class indexes.
|
boolean |
areIndexed(String className,
String... fields) |
boolean |
autoRecreateIndexesAfterCrash()
Checks if indexes should be automatically recreated.
|
void |
create()
Creates a document where index manager configuration is saved and creates a "dictionary" index.
|
OIndex<?> |
createIndex(String iName,
String iType,
OIndexDefinition indexDefinition,
int[] clusterIdsToIndex,
OProgressListener progressListener,
ODocument metadata)
Creates a new index with default algorithm.
|
OIndex<?> |
createIndex(String iName,
String iType,
OIndexDefinition iIndexDefinition,
int[] iClusterIdsToIndex,
OProgressListener progressListener,
ODocument metadata,
String algorithm)
Creates a new index.
|
OIndex<?> |
distributedCreateIndex(String iName,
String iType,
OIndexDefinition iIndexDefinition,
int[] iClusterIdsToIndex,
OProgressListener progressListener,
ODocument metadata,
String engine) |
void |
distributedDropIndex(String iName) |
OIndexManager |
dropIndex(String iIndexName)
Drop index with specified name.
|
boolean |
existsIndex(String iName)
Checks if index with specified name exists in database.
|
void |
flush()
Flushes all indexes that is registered in this manager.
|
OIndex<?> |
getClassAutoShardingIndex(String className)
Returns the auto-sharding index defined for the class, if any.
|
OIndex<?> |
getClassIndex(String className,
String indexName)
Searches for index for a specified class with specified name.
|
Set<OIndex<?>> |
getClassIndexes(String className)
Gets indexes for a specified class (excluding indexes for sub-classes).
|
void |
getClassIndexes(String className,
Collection<OIndex<?>> indexes)
Gets indexes for a specified class (excluding indexes for sub-classes).
|
Set<OIndex<?>> |
getClassInvolvedIndexes(String className,
Collection<String> fields)
Returns list of indexes that contain passed in fields names as their first keys.
|
Set<OIndex<?>> |
getClassInvolvedIndexes(String className,
String... fields)
Returns list of indexes that contain passed in fields names as their first keys.
|
void |
getClassRawIndexes(String name,
Collection<OIndex<?>> indexes) |
OIndexUnique |
getClassUniqueIndex(String className)
Returns the unique index for a class, if any.
|
ODocument |
getConfiguration()
Returns a record where configurations are saved.
|
String |
getDefaultClusterName()
IMPORTANT! Only for internal usage.
|
ODictionary<ORecord> |
getDictionary()
Return a dictionary index.
|
OIndex<?> |
getIndex(String iName)
Index by specified name.
|
Collection<? extends OIndex<?>> |
getIndexes()
Returns all indexes registered in database.
|
OIndexManager |
load()
Load index manager data from database.
|
OIndex<?> |
preProcessBeforeReturn(ODatabaseDocumentInternal database,
OIndex<?> index) |
void |
recreateIndexes()
Drops all indexes and creates them from scratch.
|
OIndexManagerProxy |
reload()
Force reloading of indexes.
|
void |
removeClassPropertyIndex(OIndex<?> idx)
Removes index from class-property map.
|
void |
removeClusterFromIndex(String clusterName,
String indexName)
Removes a cluster from tracked cluster list of specified index.
|
<RET extends ODocumentWrapper> |
save()
Saves index manager data.
|
void |
setDefaultClusterName(String defaultClusterName)
Sets the new default cluster.
|
void |
waitTillIndexRestore()
Blocks current thread till indexes will be restored.
|
public OIndexManagerProxy(OIndexManagerAbstract iDelegate, ODatabaseDocumentInternal iDatabase)
public OIndexManager load()
OIndexManager
IMPORTANT! Only for internal usage.
load
in interface OIndexManager
public OIndexManagerProxy reload()
reload
in interface OIndexManager
public void create()
OIndexManager
IMPORTANT! Only for internal usage.
create
in interface OIndexManager
public Collection<? extends OIndex<?>> getIndexes()
OIndexManager
getIndexes
in interface OIndexManager
public OIndex<?> getIndex(String iName)
OIndexManager
getIndex
in interface OIndexManager
iName
- name of indexpublic boolean existsIndex(String iName)
OIndexManager
existsIndex
in interface OIndexManager
iName
- name of index.public OIndex<?> createIndex(String iName, String iType, OIndexDefinition indexDefinition, int[] clusterIdsToIndex, OProgressListener progressListener, ODocument metadata)
OIndexManager
createIndex
in interface OIndexManager
iName
- - name of indexiType
- - index type. Specified by plugged index factories.indexDefinition
- metadata that describes index structureclusterIdsToIndex
- 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.public OIndex<?> createIndex(String iName, String iType, OIndexDefinition iIndexDefinition, int[] iClusterIdsToIndex, OProgressListener progressListener, ODocument metadata, String algorithm)
OIndexManager
May require quite a long time if big amount of data should be indexed.
createIndex
in interface OIndexManager
iName
- name of indexiType
- index type. Specified by plugged index factories.iIndexDefinition
- metadata that describes index structureiClusterIdsToIndex
- 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 usepublic OIndex<?> distributedCreateIndex(String iName, String iType, OIndexDefinition iIndexDefinition, int[] iClusterIdsToIndex, OProgressListener progressListener, ODocument metadata, String engine)
public ODocument getConfiguration()
OIndexManager
IMPORTANT! Only for internal usage.
getConfiguration
in interface OIndexManager
public OIndexManager dropIndex(String iIndexName)
OIndexManager
dropIndex
in interface OIndexManager
iIndexName
- the name of index to droppublic void distributedDropIndex(String iName)
public String getDefaultClusterName()
OIndexManager
getDefaultClusterName
in interface OIndexManager
public void setDefaultClusterName(String defaultClusterName)
OIndexManager
IMPORTANT! Only for internal usage.
setDefaultClusterName
in interface OIndexManager
defaultClusterName
- name of new default clusterpublic ODictionary<ORecord> getDictionary()
OIndexManager
getDictionary
in interface OIndexManager
public void flush()
OIndexManager
flush
in interface OIndexManager
public Set<OIndex<?>> getClassInvolvedIndexes(String className, Collection<String> fields)
OIndexManager
getClassInvolvedIndexes
in interface OIndexManager
className
- name of class which is indexed.fields
- Field names.public Set<OIndex<?>> getClassInvolvedIndexes(String className, String... fields)
OIndexManager
getClassInvolvedIndexes
in interface OIndexManager
className
- name of class which is indexed.fields
- Field names.public boolean areIndexed(String className, Collection<String> fields)
OIndexManager
areIndexed
in interface OIndexManager
className
- name of class which contain fields
.fields
- Field names.true
if given fields are contained as first key fields in class indexes.public boolean areIndexed(String className, String... fields)
areIndexed
in interface OIndexManager
className
- name of class which contain fields
.fields
- Field names.true
if given fields are contained as first key fields in class indexes.OIndexManager.areIndexed(String, java.util.Collection)
public Set<OIndex<?>> getClassIndexes(String className)
OIndexManager
getClassIndexes
in interface OIndexManager
className
- name of class which is indexed.public void getClassIndexes(String className, Collection<OIndex<?>> indexes)
OIndexManager
getClassIndexes
in interface OIndexManager
className
- name of class which is indexed.indexes
- Collection of indexes where to add all the indexespublic OIndex<?> getClassIndex(String className, String indexName)
OIndexManager
getClassIndex
in interface OIndexManager
className
- name of class which is indexed.indexName
- name of index.public OIndexUnique getClassUniqueIndex(String className)
OIndexManager
getClassUniqueIndex
in interface OIndexManager
public OIndex<?> getClassAutoShardingIndex(String className)
OIndexManager
getClassAutoShardingIndex
in interface OIndexManager
className
- Class namepublic void recreateIndexes()
OIndexManager
recreateIndexes
in interface OIndexManager
public void waitTillIndexRestore()
OIndexManager
waitTillIndexRestore
in interface OIndexManager
public boolean autoRecreateIndexesAfterCrash()
OIndexManager
IMPORTANT! Only for internal usage.
autoRecreateIndexesAfterCrash
in interface OIndexManager
public void addClusterToIndex(String clusterName, String indexName)
OIndexManager
IMPORTANT! Only for internal usage.
addClusterToIndex
in interface OIndexManager
clusterName
- cluster to add.indexName
- name of index.public void removeClusterFromIndex(String clusterName, String indexName)
OIndexManager
IMPORTANT! Only for internal usage.
removeClusterFromIndex
in interface OIndexManager
clusterName
- cluster to remove.indexName
- name of index.public <RET extends ODocumentWrapper> RET save()
OIndexManager
IMPORTANT! Only for internal usage.
save
in interface OIndexManager
public void removeClassPropertyIndex(OIndex<?> idx)
OIndexManager
IMPORTANT! Only for internal usage.
removeClassPropertyIndex
in interface OIndexManager
idx
- index to remove.public void getClassRawIndexes(String name, Collection<OIndex<?>> indexes)
public OIndex<?> preProcessBeforeReturn(ODatabaseDocumentInternal database, OIndex<?> index)
Copyright © 2009–2019 OrientDB. All rights reserved.