@NotThreadSafe public final class InodeDirectory extends Inode<InodeDirectory>
Inode.lockRead()
or Inode.lockWrite()
) before methods are called.mCreationTimeMs, mDirectory, mId, mTtl, mTtlAction
Modifier and Type | Method and Description |
---|---|
boolean |
addChild(Inode<?> child)
Adds the given inode to the set of children.
|
boolean |
areDescendantsLoaded()
Before calling this method, the caller should hold at least a READ LOCK on the inode.
|
static InodeDirectory |
create(long id,
long parentId,
String name,
CreateDirectoryOptions options)
Creates an
InodeDirectory . |
static InodeDirectory |
fromJournalEntry(File.InodeDirectoryEntry entry)
Converts the entry to an
InodeDirectory . |
FileInfo |
generateClientFileInfo(String path)
Generates client file info for a folder.
|
Inode<?> |
getChild(String name) |
Inode<?> |
getChildReadLock(String name,
InodeLockList lockList) |
Set<Inode<?>> |
getChildren() |
Set<Long> |
getChildrenIds() |
Inode<?> |
getChildWriteLock(String name,
InodeLockList lockList) |
int |
getNumberOfChildren() |
protected InodeDirectory |
getThis() |
boolean |
isDirectChildrenLoaded() |
boolean |
isMountPoint() |
boolean |
removeChild(Inode<?> child)
Removes the given inode from the directory.
|
boolean |
removeChild(String name)
Removes the given child by its name from the directory.
|
InodeDirectory |
setDirectChildrenLoaded(boolean directChildrenLoaded) |
InodeDirectory |
setMountPoint(boolean mountPoint) |
Journal.JournalEntry |
toJournalEntry() |
String |
toString() |
compareAndSwap, equals, getCreationTimeMs, getGroup, getId, getLastModificationTimeMs, getMode, getName, getOwner, getParentId, getPersistenceState, getTtl, getTtlAction, getUfsFingerprint, hashCode, isDeleted, isDirectory, isFile, isPersisted, isPinned, isReadLocked, isWriteLocked, lockRead, lockReadAndCheckNameAndParent, lockReadAndCheckParent, lockWrite, lockWriteAndCheckNameAndParent, lockWriteAndCheckParent, setCreationTimeMs, setDeleted, setGroup, setLastModificationTimeMs, setLastModificationTimeMs, setMode, setName, setOwner, setParentId, setPersistenceState, setPinned, setTtl, setTtlAction, setUfsFingerprint, toStringHelper, unlockRead, unlockWrite
protected InodeDirectory getThis()
getThis
in class Inode<InodeDirectory>
this
so that the abstract class can use the fluent builder patternpublic boolean addChild(Inode<?> child)
child
- the inode to addpublic Inode<?> getChild(String name)
name
- the name of the child@Nullable public Inode<?> getChildReadLock(String name, InodeLockList lockList) throws InvalidPathException
name
- the name of the childlockList
- the lock list to add the lock toInvalidPathException
- if the path to the child is invalid@Nullable public Inode<?> getChildWriteLock(String name, InodeLockList lockList) throws InvalidPathException
name
- the name of the childlockList
- the lock list to add the lock toInvalidPathException
- if the path to the child is invalidpublic int getNumberOfChildren()
public boolean isMountPoint()
public boolean isDirectChildrenLoaded()
public boolean areDescendantsLoaded()
public boolean removeChild(Inode<?> child)
child
- the Inode to removepublic boolean removeChild(String name)
name
- the name of the Inode to removepublic InodeDirectory setMountPoint(boolean mountPoint)
mountPoint
- the mount point flag value to usepublic InodeDirectory setDirectChildrenLoaded(boolean directChildrenLoaded)
directChildrenLoaded
- whether to load the direct children if they were not loaded beforepublic FileInfo generateClientFileInfo(String path)
generateClientFileInfo
in class Inode<InodeDirectory>
path
- the path of the folder in the filesystemFileInfo
public static InodeDirectory fromJournalEntry(File.InodeDirectoryEntry entry)
InodeDirectory
.entry
- the entry to convertInodeDirectory
representationpublic static InodeDirectory create(long id, long parentId, String name, CreateDirectoryOptions options)
InodeDirectory
.id
- id of this inodeparentId
- id of the parent of this inodename
- name of this inodeoptions
- options to create this directoryInodeDirectory
representationpublic Journal.JournalEntry toJournalEntry()
Journal.JournalEntry
representing this objectCopyright © 2023. All Rights Reserved.