public class InodeLockManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
LockPool<Edge> |
mEdgeLocks
Cache for supplying edge locks, similar to mInodeLocks.
|
LockPool<java.lang.Long> |
mInodeLocks
Pool for supplying inode locks.
|
| Constructor and Description |
|---|
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.
|
LockResource |
lockEdge(Edge edge,
LockMode mode)
Acquires an edge lock.
|
LockResource |
lockInode(InodeView inode,
LockMode mode)
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<LockResource> |
tryLockEdge(Edge edge,
LockMode mode)
Attempts to acquire an edge lock.
|
java.util.Optional<LockResource> |
tryLockInode(java.lang.Long inodeId,
LockMode mode)
Attempts to acquire an inode lock.
|
public final LockPool<java.lang.Long> mInodeLocks
public void assertAllLocksReleased()
public LockResource lockInode(InodeView inode, LockMode mode)
inode - the inode to lockmode - the mode to lock inpublic java.util.Optional<LockResource> tryLockInode(java.lang.Long inodeId, LockMode mode)
inodeId - the inode id to try lockingmode - the mode to lock inpublic LockResource lockEdge(Edge edge, LockMode mode)
edge - the edge to lockmode - the mode to lock inpublic java.util.Optional<LockResource> 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 lockCopyright © 2019. All Rights Reserved.