@ThreadSafe public final class CachingInodeStore extends java.lang.Object implements InodeStore, java.io.Closeable
HeapInodeStore. Once the cache reaches the high
watermark, we begin evicting metadata to the backing store, and performance becomes dependent on
cache hit rate and backing store performance.
InodeCache, EdgeCache, and ListingCache for details
about their inner workings.InodeStore.Factory, InodeStore.WriteBatch| Constructor and Description |
|---|
CachingInodeStore(InodeStore backingStore,
InodeLockManager lockManager) |
| 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.
|
void |
close() |
CheckpointName |
getCheckpointName() |
java.util.Optional<Inode> |
getChild(java.lang.Long inodeId,
java.lang.String name,
ReadOption option) |
java.util.Optional<java.lang.Long> |
getChildId(java.lang.Long inodeId,
java.lang.String name,
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.util.Optional<MutableInode<?>> |
getMutable(long id,
ReadOption option)
Gets a mutable representation of the specified inode.
|
boolean |
hasChildren(InodeDirectoryView inode,
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 |
writeNewInode(MutableInode<?> inode)
Adds a new inode.
|
void |
writeToCheckpoint(java.io.OutputStream output) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChild, createWriteBatch, get, getMutable, remove, removeInodeAndParentEdge, supportsBatchWriteget, getChild, getChild, getChild, getChildId, getChildId, getChildId, getChildIds, getChildIds, getChildIds, getChildren, getChildren, getChildren, getChildren, hasChildrenpublic CachingInodeStore(InodeStore backingStore, InodeLockManager lockManager)
backingStore - the backing inode storelockManager - inode lock managerpublic java.util.Optional<MutableInode<?>> getMutable(long id, ReadOption option)
InodeStoregetMutable in interface InodeStoreid - an inode idoption - read optionspublic 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 writeNewInode(MutableInode<?> inode)
InodeStoreInodeStore.writeInode(MutableInode), but with an added information that
the inode is new. This allows some inode stores to perform extra optimizations.
This method requires an inode lock manager read or write lock on the written inode.writeNewInode in interface InodeStoreinode - the inode to writepublic void clear()
InodeStoreclear in interface InodeStorepublic 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.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.util.Optional<java.lang.Long> getChildId(java.lang.Long inodeId,
java.lang.String name,
ReadOption option)
getChildId in interface ReadOnlyInodeStoreinodeId - an inode idname - an inode nameoption - the optionspublic java.util.Optional<Inode> getChild(java.lang.Long inodeId, java.lang.String name, ReadOption option)
getChild in interface ReadOnlyInodeStoreinodeId - an inode idname - an inode nameoption - the optionspublic boolean hasChildren(InodeDirectoryView inode, ReadOption option)
hasChildren in interface ReadOnlyInodeStoreinode - an inode directoryoption - the optionspublic java.util.Set<EdgeEntry> allEdges()
allEdges in interface ReadOnlyInodeStorepublic java.util.Set<MutableInode<?>> allInodes()
allInodes in interface ReadOnlyInodeStorepublic void close()
close in interface InodeStoreclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic CheckpointName getCheckpointName()
getCheckpointName in interface Checkpointedpublic 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.IOExceptionCopyright © 2020. All Rights Reserved.