@ThreadSafe public abstract class LockedInodePath extends Object implements Closeable
Inode
, starting from the root.Modifier and Type | Field and Description |
---|---|
protected InodeLockList |
mLockList |
protected InodeTree.LockMode |
mLockMode |
protected String[] |
mPathComponents |
protected AlluxioURI |
mUri |
Modifier and Type | Method and Description |
---|---|
void |
close() |
LockedInodePath |
createTempPathForChild(String childName)
Constructs a temporary
LockedInodePath from an existing LockedInodePath , for
a direct child of the existing path. |
LockedInodePath |
createTempPathForExistingChild(Inode<?> child,
InodeTree.LockMode lockMode)
Constructs a temporary
LockedInodePath from an existing LockedInodePath , for
a direct child of the existing path. |
void |
downgradeLast()
Downgrades the last inode that was locked, if the inode was previously WRITE locked.
|
void |
downgradeLastWithScheme(LockingScheme lockingScheme)
Downgrades the last inode that was locked, according to the specified
LockingScheme . |
boolean |
fullPathExists() |
Inode<?> |
getAncestorInode()
Returns the closest ancestor of the target inode (last inode in the full path).
|
Inode<?> |
getInode() |
InodeFile |
getInodeFile() |
List<Inode<?>> |
getInodeList() |
Inode<?> |
getInodeOrNull() |
Inode |
getLastExistingInode() |
InodeTree.LockMode |
getLockMode() |
InodeDirectory |
getParentInodeDirectory() |
Inode |
getParentInodeOrNull() |
AlluxioURI |
getUri() |
void |
unlockLast()
Unlocks the last inode that was locked.
|
protected final AlluxioURI mUri
protected final String[] mPathComponents
protected final InodeLockList mLockList
protected InodeTree.LockMode mLockMode
public AlluxioURI getUri()
public Inode<?> getInode() throws FileDoesNotExistException
FileDoesNotExistException
- if the target inode does not exist@Nullable public Inode<?> getInodeOrNull()
public InodeFile getInodeFile() throws FileDoesNotExistException
InodeFile
FileDoesNotExistException
- if the target inode does not exist, or it is not a filepublic InodeDirectory getParentInodeDirectory() throws InvalidPathException, FileDoesNotExistException
InvalidPathException
- if the parent inode is not a directoryFileDoesNotExistException
- if the parent of the target does not exist@Nullable public Inode getParentInodeOrNull()
public Inode getLastExistingInode()
public List<Inode<?>> getInodeList()
public boolean fullPathExists()
public InodeTree.LockMode getLockMode()
InodeTree.LockMode
of this pathpublic void close()
close
in interface Closeable
close
in interface AutoCloseable
public void downgradeLast()
public void downgradeLastWithScheme(LockingScheme lockingScheme)
LockingScheme
.
If the locking scheme initially desired the READ lock, the downgrade will occur. Otherwise,
downgrade will not be performed.lockingScheme
- the locking scheme to inspectpublic Inode<?> getAncestorInode() throws FileDoesNotExistException
FileDoesNotExistException
- if an ancestor does not existpublic LockedInodePath createTempPathForChild(String childName) throws InvalidPathException
LockedInodePath
from an existing LockedInodePath
, for
a direct child of the existing path. The child does not exist yet, this method simply adds
the child to the path.childName
- the name of the direct childLockedInodePath
for the direct childInvalidPathException
- if the path is invalidpublic LockedInodePath createTempPathForExistingChild(Inode<?> child, InodeTree.LockMode lockMode) throws InvalidPathException, FileDoesNotExistException
LockedInodePath
from an existing LockedInodePath
, for
a direct child of the existing path. The child must exist and this method will lock the child.
A new LockedInodePath
object is returned. When the returned temporary path is closed,
it does not close the existing path.child
- the inode of the direct childlockMode
- the desired locking mode for the childLockedInodePath
for the direct childInvalidPathException
- if the path is invalidFileDoesNotExistException
- if the file does not existpublic void unlockLast()
Copyright © 2023. All Rights Reserved.