@ThreadSafe public class HeapInodeStore extends java.lang.Object implements InodeStore
InodeStore.Factory, InodeStore.WriteBatch| Constructor and Description |
|---|
HeapInodeStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(long parentId,
java.lang.String childName,
java.lang.Long childId)
Makes an inode the child of the specified parent.
|
java.util.Set<EdgeEntry> |
allEdges() |
java.util.Set<MutableInode<?>> |
allInodes() |
void |
clear()
Removes all inodes and edges.
|
CheckpointName |
getCheckpointName() |
java.util.Optional<Inode> |
getChild(java.lang.Long inodeId,
java.lang.String child,
ReadOption option) |
java.util.Optional<java.lang.Long> |
getChildId(java.lang.Long inodeId,
java.lang.String child,
ReadOption option) |
java.lang.Iterable<java.lang.Long> |
getChildIds(java.lang.Long inodeId,
ReadOption option)
Returns an iterable for the ids of the children of the given directory.
|
java.lang.Iterable<? extends Inode> |
getChildren(java.lang.Long inodeId,
ReadOption option)
Returns an iterator over the children of the specified inode.
|
java.util.Optional<MutableInode<?>> |
getMutable(long id,
ReadOption option)
Gets a mutable representation of the specified inode.
|
boolean |
hasChildren(InodeDirectoryView dir,
ReadOption option) |
void |
remove(java.lang.Long inodeId)
Removes an inode from the inode store.
|
void |
removeChild(long parentId,
java.lang.String name)
Removes a child from a parent inode.
|
void |
restoreFromCheckpoint(CheckpointInputStream input) |
void |
writeInode(MutableInode<?> inode)
Adds the given inode, or overwrites it if it already exists.
|
void |
writeToCheckpoint(java.io.OutputStream output) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChild, close, createWriteBatch, get, getMutable, remove, removeInodeAndParentEdge, supportsBatchWrite, writeNewInodeget, getChild, getChild, getChild, getChildId, getChildId, getChildId, getChildIds, getChildIds, getChildIds, getChildren, getChildren, getChildren, hasChildrenpublic void remove(java.lang.Long inodeId)
InodeStoreremove in interface InodeStoreinodeId - an inode to removepublic void writeInode(MutableInode<?> inode)
InodeStoreInodeStore.writeNewInode(MutableInode).
This method requires an inode lock manager read or write lock on the written inode.writeInode in interface InodeStoreinode - the inode to writepublic void addChild(long parentId,
java.lang.String childName,
java.lang.Long childId)
InodeStoreaddChild in interface InodeStoreparentId - the parent idchildName - the child namechildId - the child inode idpublic void removeChild(long parentId,
java.lang.String name)
InodeStoreremoveChild in interface InodeStoreparentId - the parent inode idname - the child namepublic java.util.Optional<MutableInode<?>> getMutable(long id, ReadOption option)
InodeStoregetMutable in interface InodeStoreid - an inode idoption - read optionspublic java.lang.Iterable<java.lang.Long> getChildIds(java.lang.Long inodeId,
ReadOption option)
ReadOnlyInodeStoregetChildIds in interface ReadOnlyInodeStoreinodeId - an inode id to list child ids foroption - the optionspublic java.lang.Iterable<? extends Inode> getChildren(java.lang.Long inodeId, ReadOption option)
ReadOnlyInodeStoregetChildren in interface ReadOnlyInodeStoreinodeId - an inode idoption - the optionspublic java.util.Optional<java.lang.Long> getChildId(java.lang.Long inodeId,
java.lang.String child,
ReadOption option)
getChildId in interface ReadOnlyInodeStoreinodeId - an inode idchild - an inode nameoption - the optionspublic java.util.Optional<Inode> getChild(java.lang.Long inodeId, java.lang.String child, ReadOption option)
getChild in interface ReadOnlyInodeStoreinodeId - an inode idchild - an inode nameoption - the optionspublic boolean hasChildren(InodeDirectoryView dir, ReadOption option)
hasChildren in interface ReadOnlyInodeStoredir - an inode directoryoption - the optionspublic java.util.Set<EdgeEntry> allEdges()
allEdges in interface ReadOnlyInodeStorepublic java.util.Set<MutableInode<?>> allInodes()
allInodes in interface ReadOnlyInodeStorepublic void clear()
InodeStoreclear in interface InodeStorepublic void writeToCheckpoint(java.io.OutputStream output)
throws java.io.IOException,
java.lang.InterruptedException
writeToCheckpoint in interface Checkpointedjava.io.IOExceptionjava.lang.InterruptedExceptionpublic void restoreFromCheckpoint(CheckpointInputStream input) throws java.io.IOException
restoreFromCheckpoint in interface Checkpointedjava.io.IOExceptionpublic CheckpointName getCheckpointName()
getCheckpointName in interface CheckpointedCopyright © 2019. All Rights Reserved.