public class MemoryLocks extends Object
Constructor and Description |
---|
MemoryLocks() |
Modifier and Type | Method and Description |
---|---|
org.apache.oozie.lock.MemoryLocks.MemoryLockToken |
getLock(String resource,
MemoryLocksService.Type type,
long wait)
Obtain a lock for a source.
|
ConcurrentMap<String,ReentrantReadWriteLock> |
getLockMap() |
int |
size()
Return the number of active locks.
|
public MemoryLocks()
public int size()
public org.apache.oozie.lock.MemoryLocks.MemoryLockToken getLock(String resource, MemoryLocksService.Type type, long wait) throws InterruptedException
resource
- resource name.type
- lock type.wait
- time out in milliseconds to wait for the lock, -1 means no timeout and 0 no wait.null
if the lock could not be obtained.InterruptedException
- thrown if the thread was interrupted while waiting.public ConcurrentMap<String,ReentrantReadWriteLock> getLockMap()
Copyright © 2018 Apache Software Foundation. All rights reserved.