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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
.
-
Constructor Details
-
DefaultIndexLockService
public DefaultIndexLockService()
-
-
Method Details
-
tryLock
Description copied from interface:IndexLockService
Tries to acquire a lock on theindex
in given time limit.- Specified by:
tryLock
in interfaceIndexLockService
- Returns:
- true if the lock was successfully acquired
-
tryLock
Description copied from interface:IndexLockService
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.- Specified by:
tryLock
in interfaceIndexLockService
- Returns:
- true if all locks were successfully acquired.
-
lock
Description copied from interface:IndexLockService
Blocks to acquire a lock onindex
.- Specified by:
lock
in interfaceIndexLockService
-
lock
Description copied from interface:IndexLockService
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.- Specified by:
lock
in interfaceIndexLockService
-
unlock
Description copied from interface:IndexLockService
Releases the lock held onindex
- Specified by:
unlock
in interfaceIndexLockService
-
unlock
Description copied from interface:IndexLockService
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.- Specified by:
unlock
in interfaceIndexLockService
-