
public abstract class OLuceneIndexEngineAbstract<V> extends OSharedResourceAdaptiveExternal implements OLuceneIndexEngine
OIndexEngine.Validator<K,V>, OIndexEngine.ValuesTransformer| Modifier and Type | Field and Description |
|---|---|
protected boolean |
automatic |
protected AtomicBoolean |
closed |
protected String |
clusterIndexName |
protected Map<String,Boolean> |
collectionFields |
protected TimerTask |
commitTask |
protected OIndexDefinition |
index |
static String |
KEY |
protected AtomicLong |
lastAccess |
protected ODocument |
metadata |
protected String |
name |
protected org.apache.lucene.search.ControlledRealTimeReopenThread |
nrt |
static String |
OLUCENE_BASE_DIR |
static String |
RID |
protected org.apache.lucene.search.SearcherManager |
searcherManager |
protected OStorage |
storage |
static String |
STORED |
protected org.apache.lucene.util.Version |
version |
| Constructor and Description |
|---|
OLuceneIndexEngineAbstract(OStorage storage,
String indexName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquireAtomicExclusiveLock(Object key)
Acquires exclusive lock in the active atomic operation running on the current thread for this index engine.
|
protected void |
addDocument(org.apache.lucene.document.Document doc) |
OLuceneTxChanges |
buildTxChanges() |
void |
clear() |
void |
close() |
void |
create(OBinarySerializer valueSerializer,
boolean isAutomatic,
OType[] keyTypes,
boolean nullPointerSupport,
OBinarySerializer keySerializer,
int keySize,
Set<String> clustersToIndex,
Map<String,String> engineProperties,
ODocument metadata) |
protected abstract org.apache.lucene.index.IndexWriter |
createIndexWriter(org.apache.lucene.store.Directory directory) |
OIndexCursor |
cursor(OIndexEngine.ValuesTransformer valuesTransformer) |
void |
delete() |
protected void |
deleteDocument(org.apache.lucene.search.Query query) |
org.apache.lucene.search.Query |
deleteQuery(Object key,
OIdentifiable value) |
void |
deleteWithoutLoad(String indexName) |
OIndexCursor |
descCursor(OIndexEngine.ValuesTransformer valuesTransformer) |
void |
flush() |
void |
freeze(boolean throwException)
After this method finished it's execution, all threads that are going to perform data modifications in storage should wait till
OFreezableStorageComponent.release() method will be called. |
protected ODatabaseDocumentInternal |
getDatabase() |
protected String |
getIndexBasePath(OLocalPaginatedStorage storageLocalAbstract) |
String |
getIndexNameByKey(Object key) |
String |
getName() |
int |
getVersion() |
org.apache.lucene.analysis.Analyzer |
indexAnalyzer() |
String |
indexName() |
void |
init(String indexName,
String indexType,
OIndexDefinition indexDefinition,
boolean isAutomatic,
ODocument metadata) |
protected void |
internalDelete(String indexName) |
protected boolean |
isCollectionDelete() |
boolean |
isCollectionIndex() |
boolean |
isFrozen()
Returns true if the storage is frozen, otherwise false.
|
protected org.apache.lucene.document.Field.Store |
isToStore(String f) |
OIndexKeyCursor |
keyCursor() |
void |
load(String indexName,
OBinarySerializer valueSerializer,
boolean isAutomatic,
OBinarySerializer keySerializer,
OType[] keyTypes,
boolean nullPointerSupport,
int keySize,
Map<String,String> engineProperties) |
abstract void |
onRecordAddedToResultSet(OLuceneQueryContext queryContext,
OContextualRecordId recordId,
org.apache.lucene.document.Document ret,
org.apache.lucene.search.ScoreDoc score) |
protected void |
openIfClosed() |
protected abstract org.apache.lucene.index.IndexWriter |
openIndexWriter(org.apache.lucene.store.Directory directory) |
org.apache.lucene.analysis.Analyzer |
queryAnalyzer() |
void |
release()
After this method finished execution all threads that are waiting to perform data modifications in storage will be awaken and
will be allowed to continue their execution.
|
protected void |
release(org.apache.lucene.search.IndexSearcher searcher) |
boolean |
remove(Object key,
OIdentifiable value) |
protected void |
reOpen() |
org.apache.lucene.search.IndexSearcher |
searcher() |
static void |
sendLookupTime(String indexName,
OCommandContext context,
org.apache.lucene.search.TopDocs docs,
Integer limit,
long startFetching) |
static void |
sendTotalHits(String indexName,
OCommandContext context,
int totalHits) |
long |
size(OIndexEngine.ValuesTransformer transformer) |
long |
sizeInTx(OLuceneTxChanges changes) |
protected void |
updateLastAccess() |
acquireExclusiveLock, acquireSharedLock, releaseExclusiveLock, releaseSharedLock, tryAcquireExclusiveLock, tryAcquireSharedLockaddUser, assertExclusiveLockHold, assertSharedLockHold, getUsers, isConcurrent, removeUserclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildDocument, buildQuery, getInTxcontains, get, getFirstKey, getLastKey, hasRangeQuerySupport, iterateEntriesBetween, iterateEntriesMajor, iterateEntriesMinor, put, remove, validatedPutpublic static final String RID
public static final String KEY
public static final String STORED
public static final String OLUCENE_BASE_DIR
protected final AtomicLong lastAccess
protected org.apache.lucene.search.SearcherManager searcherManager
protected OIndexDefinition index
protected String name
protected String clusterIndexName
protected boolean automatic
protected org.apache.lucene.search.ControlledRealTimeReopenThread nrt
protected ODocument metadata
protected org.apache.lucene.util.Version version
protected TimerTask commitTask
protected AtomicBoolean closed
protected OStorage storage
public static void sendTotalHits(String indexName, OCommandContext context, int totalHits)
public static void sendLookupTime(String indexName, OCommandContext context, org.apache.lucene.search.TopDocs docs, Integer limit, long startFetching)
protected void updateLastAccess()
protected abstract org.apache.lucene.index.IndexWriter openIndexWriter(org.apache.lucene.store.Directory directory)
throws IOException
IOExceptionprotected void addDocument(org.apache.lucene.document.Document doc)
public void init(String indexName, String indexType, OIndexDefinition indexDefinition, boolean isAutomatic, ODocument metadata)
init in interface OIndexEngineprotected void reOpen()
throws IOException
IOExceptionprotected ODatabaseDocumentInternal getDatabase()
protected abstract org.apache.lucene.index.IndexWriter createIndexWriter(org.apache.lucene.store.Directory directory)
throws IOException
IOExceptionpublic void flush()
flush in interface OIndexEnginepublic void create(OBinarySerializer valueSerializer, boolean isAutomatic, OType[] keyTypes, boolean nullPointerSupport, OBinarySerializer keySerializer, int keySize, Set<String> clustersToIndex, Map<String,String> engineProperties, ODocument metadata)
create in interface OIndexEnginepublic void delete()
delete in interface OIndexEnginepublic String indexName()
indexName in interface OLuceneIndexEngineprotected String getIndexBasePath(OLocalPaginatedStorage storageLocalAbstract)
public abstract void onRecordAddedToResultSet(OLuceneQueryContext queryContext, OContextualRecordId recordId, org.apache.lucene.document.Document ret, org.apache.lucene.search.ScoreDoc score)
onRecordAddedToResultSet in interface OLuceneIndexEnginepublic org.apache.lucene.analysis.Analyzer indexAnalyzer()
indexAnalyzer in interface OLuceneIndexEnginepublic org.apache.lucene.analysis.Analyzer queryAnalyzer()
queryAnalyzer in interface OLuceneIndexEnginepublic boolean remove(Object key, OIdentifiable value)
remove in interface OLuceneIndexEngineprotected void deleteDocument(org.apache.lucene.search.Query query)
protected boolean isCollectionDelete()
protected void openIfClosed()
public boolean isCollectionIndex()
isCollectionIndex in interface OLuceneIndexEnginepublic org.apache.lucene.search.IndexSearcher searcher()
searcher in interface OLuceneIndexEnginepublic long sizeInTx(OLuceneTxChanges changes)
sizeInTx in interface OLuceneIndexEnginepublic OLuceneTxChanges buildTxChanges() throws IOException
buildTxChanges in interface OLuceneIndexEngineIOExceptionpublic org.apache.lucene.search.Query deleteQuery(Object key, OIdentifiable value)
deleteQuery in interface OLuceneIndexEnginepublic void deleteWithoutLoad(String indexName)
deleteWithoutLoad in interface OIndexEngineprotected void internalDelete(String indexName)
public void load(String indexName, OBinarySerializer valueSerializer, boolean isAutomatic, OBinarySerializer keySerializer, OType[] keyTypes, boolean nullPointerSupport, int keySize, Map<String,String> engineProperties)
load in interface OIndexEnginepublic void clear()
clear in interface OIndexEnginepublic void close()
close in interface OIndexEnginepublic OIndexCursor descCursor(OIndexEngine.ValuesTransformer valuesTransformer)
descCursor in interface OIndexEnginepublic OIndexCursor cursor(OIndexEngine.ValuesTransformer valuesTransformer)
cursor in interface OIndexEnginepublic OIndexKeyCursor keyCursor()
keyCursor in interface OIndexEnginepublic long size(OIndexEngine.ValuesTransformer transformer)
size in interface OIndexEngineprotected void release(org.apache.lucene.search.IndexSearcher searcher)
public int getVersion()
getVersion in interface OIndexEnginepublic String getName()
getName in interface OIndexEnginepublic boolean acquireAtomicExclusiveLock(Object key)
OIndexEngineAcquires exclusive lock in the active atomic operation running on the current thread for this index engine.
If this index engine 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.
acquireAtomicExclusiveLock in interface OIndexEnginekey - the index key to lock.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.public String getIndexNameByKey(Object key)
getIndexNameByKey in interface OIndexEngineprotected org.apache.lucene.document.Field.Store isToStore(String f)
public void freeze(boolean throwException)
OFreezableStorageComponentOFreezableStorageComponent.release() method will be called. This method will wait till all ongoing modifications will be finished.freeze in interface OFreezableStorageComponentthrowException - If true OModificationOperationProhibitedException
exception will be thrown on call of methods that requires storage modification. Otherwise other threads
will wait for OFreezableStorageComponent.release() method call.public void release()
OFreezableStorageComponentrelease in interface OFreezableStorageComponentpublic boolean isFrozen()
OFreezableStorageComponentisFrozen in interface OFreezableStorageComponentCopyright © 2009–2025 OrientDB. All rights reserved.