@NotThreadSafe public class CompositeInodeLockList extends java.lang.Object implements InodeLockList
| Constructor and Description |
|---|
CompositeInodeLockList(InodeLockList baseLockList,
boolean useTryLock)
Constructs a new lock list, using an existing lock list as the base list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the lock list, releasing all locks.
|
void |
downgradeLastEdge()
Downgrades the last edge lock in the lock list from WRITE lock to READ lock.
|
void |
downgradeToReadLocks()
Downgrades all locks in the current lock list to read locks.
|
boolean |
endsInInode() |
Inode |
get(int index) |
InodeLockManager |
getInodeLockManager() |
java.util.List<Inode> |
getLockedInodes() |
LockMode |
getLockMode() |
boolean |
isEmpty() |
void |
lockEdge(Inode inode,
java.lang.String childName,
LockMode mode)
Locks an edge leading out of the last inode in the list.
|
void |
lockInode(Inode inode,
LockMode mode)
Locks the given inode and adds it to the lock list.
|
void |
lockRootEdge(LockMode mode)
Locks the root edge in the specified mode.
|
int |
numInodes() |
void |
pushWriteLockedEdge(Inode inode,
java.lang.String childName)
Leapfrogs the final edge write lock forward, reducing the lock list's write-locked scope.
|
void |
unlockLastEdge()
Unlocks the last locked edge.
|
void |
unlockLastInode()
Unlocks the last locked inode.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLockedInodeViewspublic CompositeInodeLockList(InodeLockList baseLockList, boolean useTryLock)
baseLockList - the base InodeLockList to useuseTryLock - whether or not use Lock.tryLock() or Lock.lock()public void lockRootEdge(LockMode mode)
InodeLockListlockRootEdge in interface InodeLockListmode - the mode to lock inpublic void lockInode(Inode inode, LockMode mode)
InodeLockListlockInode in interface InodeLockListinode - the inode to lockmode - the mode to lock inpublic void lockEdge(Inode inode, java.lang.String childName, LockMode mode)
InodeLockListlockEdge in interface InodeLockListinode - the parent inode of the edgechildName - the child name of the edgemode - the mode to lock inpublic void unlockLastInode()
InodeLockListunlockLastInode in interface InodeLockListpublic void unlockLastEdge()
InodeLockListunlockLastEdge in interface InodeLockListpublic void downgradeToReadLocks()
InodeLockListdowngradeToReadLocks in interface InodeLockListpublic void downgradeLastEdge()
InodeLockListdowngradeLastEdge in interface InodeLockListpublic void pushWriteLockedEdge(Inode inode, java.lang.String childName)
InodeLockListpushWriteLockedEdge in interface InodeLockListinode - the inode to add to the lock listchildName - the child name for the edge to add to the lock listpublic LockMode getLockMode()
getLockMode in interface InodeLockListLockMode.WRITE if the last entry in the list is write-locked, otherwise
LockMode.READpublic java.util.List<Inode> getLockedInodes()
getLockedInodes in interface InodeLockListpublic Inode get(int index)
get in interface InodeLockListindex - the index of the listpublic int numInodes()
numInodes in interface InodeLockListpublic boolean endsInInode()
endsInInode in interface InodeLockListpublic boolean isEmpty()
isEmpty in interface InodeLockListpublic InodeLockManager getInodeLockManager()
getInodeLockManager in interface InodeLockListpublic void close()
InodeLockListclose in interface InodeLockListclose in interface java.lang.AutoCloseableCopyright © 2020. All Rights Reserved.