public class MemoryLocks extends java.lang.Object
| Constructor and Description |
|---|
MemoryLocks() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.oozie.lock.MemoryLocks.MemoryLockToken |
getReadLock(java.lang.String resource,
long wait)
Obtain a READ lock for a source.
|
org.apache.oozie.lock.MemoryLocks.MemoryLockToken |
getWriteLock(java.lang.String resource,
long wait)
Obtain a WRITE lock for a source.
|
int |
size()
Return the number of active locks.
|
public MemoryLocks()
public int size()
public org.apache.oozie.lock.MemoryLocks.MemoryLockToken getReadLock(java.lang.String resource, long wait) throws java.lang.InterruptedException
resource - resource name.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.java.lang.InterruptedException - thrown if the thread was interrupted while waiting.public org.apache.oozie.lock.MemoryLocks.MemoryLockToken getWriteLock(java.lang.String resource, long wait) throws java.lang.InterruptedException
resource - resource name.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.java.lang.InterruptedException - thrown if the thread was interrupted while waiting.Copyright © 2018 Apache Software Foundation. All Rights Reserved.