Interface IndexLockService
-
- All Known Implementing Classes:
DefaultIndexLockService
public interface IndexLockServiceConfluence 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
All Methods Instance Methods Abstract 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
boolean tryLock(SearchIndex index, long duration, TimeUnit timeUnit)
Tries to acquire a lock on theindexin given time limit.- Returns:
- true if the lock was successfully acquired
-
tryLock
boolean tryLock(EnumSet<SearchIndex> indices, long duration, TimeUnit timeUnit)
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
void lock(SearchIndex index)
Blocks to acquire a lock onindex.
-
lock
void lock(EnumSet<SearchIndex> indices)
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
void unlock(SearchIndex index)
Releases the lock held onindex- Throws:
IllegalMonitorStateException- if the lock on the index has is not being held
-
unlock
void unlock(EnumSet<SearchIndex> indices)
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
-
-