public abstract class OLuceneIndexEngineAbstract extends OSharedResourceAdaptiveExternal implements OLuceneIndexEngine
OBaseIndexEngine.Validator<K,V>, OBaseIndexEngine.ValuesTransformer
Modifier and Type | Field and Description |
---|---|
protected Map<String,Boolean> |
collectionFields |
protected OIndexDefinition |
indexDefinition |
static String |
KEY |
protected ODocument |
metadata |
protected String |
name |
static String |
RID |
protected org.apache.lucene.util.Version |
version |
VERSION
Constructor and Description |
---|
OLuceneIndexEngineAbstract(int id,
OStorage storage,
String name) |
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(OAtomicOperation atomicOperation) |
void |
close() |
void |
create(OAtomicOperation atomicOperation,
OBinarySerializer valueSerializer,
boolean isAutomatic,
OType[] keyTypes,
boolean nullPointerSupport,
OBinarySerializer keySerializer,
int keySize,
Map<String,String> engineProperties,
OEncryption encryption) |
protected abstract org.apache.lucene.index.IndexWriter |
createIndexWriter(org.apache.lucene.store.Directory directory) |
void |
delete(OAtomicOperation atomicOperation) |
org.apache.lucene.search.Query |
deleteQuery(Object key,
OIdentifiable value) |
Stream<ORawPair<Object,ORID>> |
descStream(OBaseIndexEngine.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 static ODatabaseDocumentInternal |
getDatabase() |
int |
getId() |
String |
getIndexNameByKey(Object key) |
String |
getName() |
org.apache.lucene.analysis.Analyzer |
indexAnalyzer() |
String |
indexName() |
void |
init(String indexName,
String indexType,
OIndexDefinition indexDefinition,
boolean isAutomatic,
ODocument metadata) |
boolean |
isCollectionIndex() |
Stream<Object> |
keyStream() |
void |
load(String indexName,
OBinarySerializer valueSerializer,
boolean isAutomatic,
OBinarySerializer keySerializer,
OType[] keyTypes,
boolean nullPointerSupport,
int keySize,
Map<String,String> engineProperties,
OEncryption encryption) |
abstract void |
onRecordAddedToResultSet(OLuceneQueryContext queryContext,
OContextualRecordId recordId,
org.apache.lucene.document.Document ret,
org.apache.lucene.search.ScoreDoc score) |
protected void |
openIfClosed() |
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.
|
void |
release(org.apache.lucene.search.IndexSearcher searcher) |
boolean |
remove(Object key,
OIdentifiable value) |
org.apache.lucene.search.IndexSearcher |
searcher() |
long |
size(OBaseIndexEngine.ValuesTransformer transformer) |
long |
sizeInTx(OLuceneTxChanges changes) |
Stream<ORawPair<Object,ORID>> |
stream(OBaseIndexEngine.ValuesTransformer valuesTransformer) |
protected void |
updateLastAccess() |
acquireExclusiveLock, acquireSharedLock, releaseExclusiveLock, releaseSharedLock, tryAcquireExclusiveLock, tryAcquireSharedLock
addUser, assertExclusiveLockHold, assertSharedLockHold, getUsers, isConcurrent, removeUser
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildDocument, buildQuery, getInTx
get, getEngineAPIVersion, put, remove, update, validatedPut
hasRangeQuerySupport, iterateEntriesBetween, iterateEntriesMajor, iterateEntriesMinor
public static final String RID
public static final String KEY
protected OIndexDefinition indexDefinition
protected String name
protected ODocument metadata
protected org.apache.lucene.util.Version version
public int getId()
getId
in interface OBaseIndexEngine
protected void updateLastAccess()
protected void addDocument(org.apache.lucene.document.Document doc)
public void init(String indexName, String indexType, OIndexDefinition indexDefinition, boolean isAutomatic, ODocument metadata)
init
in interface OBaseIndexEngine
protected static ODatabaseDocumentInternal getDatabase()
protected abstract org.apache.lucene.index.IndexWriter createIndexWriter(org.apache.lucene.store.Directory directory) throws IOException
IOException
public void flush()
flush
in interface OBaseIndexEngine
public void create(OAtomicOperation atomicOperation, OBinarySerializer valueSerializer, boolean isAutomatic, OType[] keyTypes, boolean nullPointerSupport, OBinarySerializer keySerializer, int keySize, Map<String,String> engineProperties, OEncryption encryption)
create
in interface OBaseIndexEngine
public void delete(OAtomicOperation atomicOperation)
delete
in interface OBaseIndexEngine
public String indexName()
indexName
in interface OLuceneIndexEngine
public abstract void onRecordAddedToResultSet(OLuceneQueryContext queryContext, OContextualRecordId recordId, org.apache.lucene.document.Document ret, org.apache.lucene.search.ScoreDoc score)
onRecordAddedToResultSet
in interface OLuceneIndexEngine
public org.apache.lucene.analysis.Analyzer indexAnalyzer()
indexAnalyzer
in interface OLuceneIndexEngine
public org.apache.lucene.analysis.Analyzer queryAnalyzer()
queryAnalyzer
in interface OLuceneIndexEngine
public boolean remove(Object key, OIdentifiable value)
remove
in interface OLuceneIndexEngine
protected void openIfClosed()
public boolean isCollectionIndex()
isCollectionIndex
in interface OLuceneIndexEngine
public org.apache.lucene.search.IndexSearcher searcher()
searcher
in interface OLuceneIndexEngine
public long sizeInTx(OLuceneTxChanges changes)
sizeInTx
in interface OLuceneIndexEngine
public OLuceneTxChanges buildTxChanges() throws IOException
buildTxChanges
in interface OLuceneIndexEngine
IOException
public org.apache.lucene.search.Query deleteQuery(Object key, OIdentifiable value)
deleteQuery
in interface OLuceneIndexEngine
public void load(String indexName, OBinarySerializer valueSerializer, boolean isAutomatic, OBinarySerializer keySerializer, OType[] keyTypes, boolean nullPointerSupport, int keySize, Map<String,String> engineProperties, OEncryption encryption)
load
in interface OIndexEngine
public void clear(OAtomicOperation atomicOperation)
clear
in interface OBaseIndexEngine
public void close()
close
in interface OBaseIndexEngine
public Stream<ORawPair<Object,ORID>> descStream(OBaseIndexEngine.ValuesTransformer valuesTransformer)
descStream
in interface OBaseIndexEngine
public Stream<ORawPair<Object,ORID>> stream(OBaseIndexEngine.ValuesTransformer valuesTransformer)
stream
in interface OBaseIndexEngine
public Stream<Object> keyStream()
keyStream
in interface OBaseIndexEngine
public long size(OBaseIndexEngine.ValuesTransformer transformer)
size
in interface OBaseIndexEngine
public void release(org.apache.lucene.search.IndexSearcher searcher)
release
in interface OLuceneIndexEngine
public String getName()
getName
in interface OBaseIndexEngine
public boolean acquireAtomicExclusiveLock(Object key)
OBaseIndexEngine
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 OBaseIndexEngine
key
- 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 OBaseIndexEngine
public void freeze(boolean throwException)
OFreezableStorageComponent
OFreezableStorageComponent.release()
method will be called. This method
will wait till all ongoing modifications will be finished.freeze
in interface OFreezableStorageComponent
throwException
- 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()
OFreezableStorageComponent
release
in interface OFreezableStorageComponent
Copyright © 2009–2020 OrientDB. All rights reserved.