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 Summary
Constructors Constructor Description DefaultIndexLockService()
-
Method Summary
All 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
-
tryLock
public 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 interfaceIndexLockService- Returns:
- true if the lock was successfully acquired
-
tryLock
public 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 interfaceIndexLockService- Returns:
- true if all locks were successfully acquired.
-
lock
public void lock(SearchIndex index)
Description copied from interface:IndexLockServiceBlocks to acquire a lock onindex.- Specified by:
lockin interfaceIndexLockService
-
lock
public 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 interfaceIndexLockService
-
unlock
public void unlock(SearchIndex index)
Description copied from interface:IndexLockServiceReleases the lock held onindex- Specified by:
unlockin interfaceIndexLockService
-
unlock
public 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 interfaceIndexLockService
-
-