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 deadlocksConstructor 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)
IndexLockService
index
in given time limit.tryLock
in interface IndexLockService
public boolean tryLock(EnumSet<SearchIndex> indices, long duration, TimeUnit timeUnit)
IndexLockService
indices
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 IndexLockService
public void lock(SearchIndex index)
IndexLockService
index
.lock
in interface IndexLockService
public void lock(EnumSet<SearchIndex> indices)
IndexLockService
indices
. The invocation of this method should work in all-or-nothing way,
no partial subset of the locks should be acquired.lock
in interface IndexLockService
public void unlock(SearchIndex index)
IndexLockService
index
unlock
in interface IndexLockService
public void unlock(EnumSet<SearchIndex> indices)
IndexLockService
indices
. The invocation of this method should work in all-or-nothing way,
no partial subset of the locks should be released.unlock
in interface IndexLockService
Copyright © 2003–2021 Atlassian. All rights reserved.