org.infinispan.lucene.locking
Class TransactionalLockFactory
java.lang.Object
org.apache.lucene.store.LockFactory
org.infinispan.lucene.locking.TransactionalLockFactory
public class TransactionalLockFactory
- extends org.apache.lucene.store.LockFactory
Factory for locks obtained in InfinispanDirectory
,
this factory produces instances of TransactionalSharedLuceneLock
.
Usually Lucene acquires the lock when creating an IndexWriter and releases it
when closing it; these open-close operations are mapped to transactions as begin-commit,
so all changes are going to be effective at IndexWriter close.
The advantage is that a transaction rollback will be able to undo all changes
applied to the index, but this requires enough memory to hold all the changes until
the commit.
Using a TransactionalSharedLuceneLock is not compatible with Lucene's
default MergeScheduler: use an in-thread implementation like SerialMergeScheduler
indexWriter.setMergeScheduler( new SerialMergeScheduler() );
- Since:
- 4.0
- Author:
- Sanne Grinovero, Lukasz Moren
- See Also:
InfinispanDirectory
,
TransactionalSharedLuceneLock
,
SerialMergeScheduler
Fields inherited from class org.apache.lucene.store.LockFactory |
lockPrefix |
Methods inherited from class org.apache.lucene.store.LockFactory |
getLockPrefix, setLockPrefix |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransactionalLockFactory
public TransactionalLockFactory(Cache cache,
String indexName)
makeLock
public org.infinispan.lucene.locking.TransactionalSharedLuceneLock makeLock(String lockName)
-
- Specified by:
makeLock
in class org.apache.lucene.store.LockFactory
clearLock
public void clearLock(String lockName)
-
- Specified by:
clearLock
in class org.apache.lucene.store.LockFactory
Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.