@LuceneIndependent public class DefaultIndexLockService extends Object implements IndexLockService
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| Constructor and Description |
|---|
DefaultIndexLockService() |
| Modifier and Type | Method and Description |
|---|---|
void |
lock(EnumSet<SearchIndex> indices)
Blocks to acquire a lock on
indices. |
void |
lock(SearchIndex index)
Blocks to acquire a lock on
index. |
boolean |
tryLock(EnumSet<SearchIndex> indices,
long duration,
TimeUnit timeUnit)
Tries to acquire a lock on
indices in given time limit. |
boolean |
tryLock(SearchIndex index,
long duration,
TimeUnit timeUnit)
Tries to acquire a lock on the
index in given time limit. |
void |
unlock(EnumSet<SearchIndex> indices)
Releases the lock held on
indices. |
void |
unlock(SearchIndex index)
Releases the lock held on
index |
public boolean tryLock(SearchIndex index, long duration, TimeUnit timeUnit)
IndexLockServiceindex in given time limit.tryLock in interface IndexLockServicepublic boolean tryLock(EnumSet<SearchIndex> indices, long duration, TimeUnit timeUnit)
IndexLockServiceindices 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.tryLock in interface IndexLockServicepublic void lock(SearchIndex index)
IndexLockServiceindex.lock in interface IndexLockServicepublic void lock(EnumSet<SearchIndex> indices)
IndexLockServiceindices. The invocation of this method should work in all-or-nothing way,
no partial subset of the locks should be acquired.lock in interface IndexLockServicepublic void unlock(SearchIndex index)
IndexLockServiceindexunlock in interface IndexLockServicepublic void unlock(EnumSet<SearchIndex> indices)
IndexLockServiceindices. The invocation of this method should work in all-or-nothing way,
no partial subset of the locks should be released.unlock in interface IndexLockServiceCopyright © 2003–2022 Atlassian. All rights reserved.