Class DefaultIndexLockService
java.lang.Object
com.atlassian.confluence.internal.index.lucene.DefaultIndexLockService
- All Implemented Interfaces:
IndexLockService
The implementation of
IndexLockService which 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: EnumSet guarantees iteration order, therefore lock ordering will automatically prevent deadlocks- Since:
- 7.9.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidlock(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.
-
Constructor Details
-
DefaultIndexLockService
public DefaultIndexLockService()
-
-
Method Details
-
tryLock
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
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
Description copied from interface:IndexLockServiceBlocks to acquire a lock onindex.- Specified by:
lockin interfaceIndexLockService
-
lock
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
Description copied from interface:IndexLockServiceReleases the lock held onindex- Specified by:
unlockin interfaceIndexLockService
-
unlock
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
-