@ThreadSafe public class RocksInodeStore extends java.lang.Object implements InodeStore
| Modifier and Type | Class and Description |
|---|---|
protected class |
RocksInodeStore.RocksInodeViewIterator
Used to iterate over inodes stored in this store.
|
InodeStore.Factory, InodeStore.WriteBatch| Constructor and Description |
|---|
RocksInodeStore(java.lang.String baseDir)
Creates and initializes a rocks block store.
|
| 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() |
InodeStore.WriteBatch |
createWriteBatch()
Creates a write batch.
|
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) |
java.util.Iterator<InodeView> |
iterator() |
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) |
boolean |
supportsBatchWrite() |
java.lang.String |
toStringEntries() |
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, get, getMutable, remove, removeInodeAndParentEdge, writeNewInodeget, getChild, getChild, getChild, getChildId, getChildId, getChildId, getChildIds, getChildIds, getChildIds, getChildren, getChildren, getChildren, getChildren, hasChildrenpublic RocksInodeStore(java.lang.String baseDir)
baseDir - the base directory in which to store inode metadatapublic 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 InodeStore.WriteBatch createWriteBatch()
InodeStoreInodeStore.supportsBatchWrite().createWriteBatch in interface InodeStoreInodeStore.WriteBatch which can be used to perform a batched 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.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.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 java.util.Iterator<InodeView> iterator()
public boolean supportsBatchWrite()
supportsBatchWrite in interface InodeStorepublic 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.IOExceptionpublic void close()
close in interface InodeStoreclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic java.lang.String toStringEntries()
Copyright © 2019. All Rights Reserved.