Interface IndexLockService
- All Known Implementing Classes:
DefaultIndexLockService
public interface IndexLockService
Confluence has multiple indexes and some operations on them are mutually exclusive. This component is designed
to help managing the state of the indexing processes. Each index has a lock which can be acquired and released.
It is meant to be used by index managers (
IncrementalIndexManager,
FullReindexManager, not directly by the client code).- Since:
- 7.9.0
-
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.
-
Method Details
-
tryLock
Tries to acquire a lock on theindexin given time limit.- Returns:
- true if the lock was successfully acquired
-
tryLock
Tries 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.- Returns:
- true if all locks were successfully acquired.
-
lock
Blocks to acquire a lock onindex. -
lock
Blocks 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. -
unlock
Releases the lock held onindex- Throws:
IllegalMonitorStateException- if the lock on the index has is not being held
-
unlock
Releases 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.- Throws:
IllegalMonitorStateException- if the lock on one of the provided indices is not being held
-