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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
lock(SearchIndex index)
Blocks to acquire a lock onindex
.void
lock(EnumSet<SearchIndex> indices)
Blocks to acquire a lock onindices
.boolean
tryLock(SearchIndex index, long duration, TimeUnit timeUnit)
Tries to acquire a lock on theindex
in given time limit.boolean
tryLock(EnumSet<SearchIndex> indices, long duration, TimeUnit timeUnit)
Tries to acquire a lock onindices
in given time limit.void
unlock(SearchIndex index)
Releases the lock held onindex
void
unlock(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 theindex
in 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 onindices
in 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
-
-