public class InodeLockManager
extends java.lang.Object
implements java.io.Closeable
| Constructor and Description |
|---|
InodeLockManager()
Creates a new instance of
InodeLockManager. |
| Modifier and Type | Method and Description |
|---|---|
void |
assertAllLocksReleased()
Asserts that all locks have been released, throwing an exception if any locks are still taken.
|
void |
close() |
RWLockResource |
lockEdge(Edge edge,
LockMode mode,
boolean useTryLock)
Acquires an edge lock.
|
RWLockResource |
lockInode(InodeView inode,
LockMode mode,
boolean useTryLock)
Acquires an inode lock.
|
LockResource |
lockUpdate(long inodeId)
Acquires the lock for modifying an inode's last modified time or size.
|
java.util.Optional<Scoped> |
tryAcquirePersistingLock(long inodeId)
Tries to acquire a lock for persisting the specified inode id.
|
java.util.Optional<RWLockResource> |
tryLockEdge(Edge edge,
LockMode mode)
Attempts to acquire an edge lock.
|
java.util.Optional<RWLockResource> |
tryLockInode(java.lang.Long inodeId,
LockMode mode)
Attempts to acquire an inode lock.
|
public InodeLockManager()
InodeLockManager.public void assertAllLocksReleased()
public RWLockResource lockInode(InodeView inode, LockMode mode, boolean useTryLock)
inode - the inode to lockmode - the mode to lock inuseTryLock - whether to acquire with Lock.tryLock() or Lock.lock(). This
method differs from tryLockInode(Long, LockMode) because it will
block until the inode has been successfully locked.tryLockInode(Long, LockMode)public java.util.Optional<RWLockResource> tryLockInode(java.lang.Long inodeId, LockMode mode)
inodeId - the inode id to try lockingmode - the mode to lock inpublic RWLockResource lockEdge(Edge edge, LockMode mode, boolean useTryLock)
edge - the edge to lockmode - the mode to lock inuseTryLock - whether to acquire with Lock.tryLock() or Lock.lock(). This
method differs from tryLockEdge(Edge, LockMode) because it will
block until the edge has been successfully locked.tryLockEdge(Edge, LockMode)public java.util.Optional<RWLockResource> tryLockEdge(Edge edge, LockMode mode)
edge - the edge to try lockingmode - the mode to lock inpublic java.util.Optional<Scoped> tryAcquirePersistingLock(long inodeId)
inodeId - the inode to acquire the lock forpublic LockResource lockUpdate(long inodeId)
inodeId - the id of the inode to lockpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionCopyright © 2020. All Rights Reserved.