Class DefaultIndexLockService
- java.lang.Object
- 
- com.atlassian.confluence.internal.index.lucene.DefaultIndexLockService
 
- 
- All Implemented Interfaces:
- IndexLockService
 
 @LuceneIndependent public class DefaultIndexLockService extends Object implements IndexLockService The implementation ofIndexLockServicewhich initialises all lock in memory. This is what we need for indexes which are stored locally and are accessed only from this JVM. Please note:EnumSetguarantees iteration order, therefore lock ordering will automatically prevent deadlocks- Since:
- 7.9.0
 
- 
- 
Constructor SummaryConstructors Constructor Description DefaultIndexLockService()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidlock(SearchIndex index)Blocks to acquire a lock onindex.voidlock(EnumSet<SearchIndex> indices)Blocks to acquire a lock onindices.booleantryLock(SearchIndex index, long duration, TimeUnit timeUnit)Tries to acquire a lock on theindexin given time limit.booleantryLock(EnumSet<SearchIndex> indices, long duration, TimeUnit timeUnit)Tries to acquire a lock onindicesin given time limit.voidunlock(SearchIndex index)Releases the lock held onindexvoidunlock(EnumSet<SearchIndex> indices)Releases the lock held onindices.
 
- 
- 
- 
Method Detail- 
tryLockpublic boolean tryLock(SearchIndex index, long duration, TimeUnit timeUnit) Description copied from interface:IndexLockServiceTries to acquire a lock on theindexin given time limit.- Specified by:
- tryLockin interface- IndexLockService
- Returns:
- true if the lock was successfully acquired
 
 - 
tryLockpublic boolean tryLock(EnumSet<SearchIndex> indices, long duration, TimeUnit timeUnit) Description copied from interface:IndexLockServiceTries to acquire a lock onindicesin given time limit. The invocation of this method should work in all-or-nothing way, no partial subset of the locks should be acquired.- Specified by:
- tryLockin interface- IndexLockService
- Returns:
- true if all locks were successfully acquired.
 
 - 
lockpublic void lock(SearchIndex index) Description copied from interface:IndexLockServiceBlocks to acquire a lock onindex.- Specified by:
- lockin interface- IndexLockService
 
 - 
lockpublic void lock(EnumSet<SearchIndex> indices) Description copied from interface:IndexLockServiceBlocks to acquire a lock onindices. The invocation of this method should work in all-or-nothing way, no partial subset of the locks should be acquired.- Specified by:
- lockin interface- IndexLockService
 
 - 
unlockpublic void unlock(SearchIndex index) Description copied from interface:IndexLockServiceReleases the lock held onindex- Specified by:
- unlockin interface- IndexLockService
 
 - 
unlockpublic void unlock(EnumSet<SearchIndex> indices) Description copied from interface:IndexLockServiceReleases the lock held onindices. The invocation of this method should work in all-or-nothing way, no partial subset of the locks should be released.- Specified by:
- unlockin interface- IndexLockService
 
 
- 
 
-