@ThreadSafe public interface InodeStore extends ReadOnlyInodeStore, Checkpointed, Closeable
Modifier and Type | Interface and Description |
---|---|
static interface |
InodeStore.Factory
Factory for creating inode stores.
|
static interface |
InodeStore.WriteBatch
Used to perform batched writes.
|
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
default void |
addChild(long parentId,
InodeView child)
Makes an inode the child of the specified parent.
|
void |
addChild(long parentId,
String childName,
Long childId)
Makes an inode the child of the specified parent.
|
void |
clear()
Removes all inodes and edges.
|
default void |
close() |
default InodeStore.WriteBatch |
createWriteBatch()
Creates a write batch.
|
default Optional<Inode> |
get(long id,
ReadOption option) |
default String |
getInodePathString(InodeView inode)
Traverses the inode path starting from the given inode up to the root.
|
default Optional<MutableInode<?>> |
getMutable(long id) |
Optional<MutableInode<?>> |
getMutable(long id,
ReadOption option)
Gets a mutable representation of the specified inode.
|
default void |
remove(InodeView inode)
Removes an inode from the inode store.
|
void |
remove(Long inodeId)
Removes an inode from the inode store.
|
void |
removeChild(long parentId,
String name)
Removes a child from a parent inode.
|
default void |
removeInodeAndParentEdge(InodeView inode)
Removes an inode and the edge leading to it from the inode store.
|
default boolean |
supportsBatchWrite() |
void |
writeInode(MutableInode<?> inode)
Adds the given inode, or overwrites it if it already exists.
|
default void |
writeNewInode(MutableInode<?> inode)
Adds a new inode.
|
allEdges, allInodes, get, getChild, getChild, getChild, getChild, getChildId, getChildId, getChildId, getChildIds, getChildIds, getChildIds, getChildren, getChildren, getChildren, getChildren, getChildrenFrom, getChildrenPrefix, getChildrenPrefixFrom, hasChildren, hasChildren
getCheckpointName, restoreFromCheckpoint, writeToCheckpoint
Optional<MutableInode<?>> getMutable(long id, ReadOption option)
id
- an inode idoption
- read optionsdefault Optional<MutableInode<?>> getMutable(long id)
id
- an inode idgetMutable(long, ReadOption)
with default optiondefault Optional<Inode> get(long id, ReadOption option)
get
in interface ReadOnlyInodeStore
id
- an inode idoption
- the optionsvoid remove(Long inodeId)
inodeId
- an inode to removedefault void remove(InodeView inode)
inode
- an inode to removedefault void removeInodeAndParentEdge(InodeView inode)
inode
- an inode to removevoid writeInode(MutableInode<?> inode)
writeNewInode(MutableInode)
.
This method requires an inode lock manager read or write lock on the written inode.inode
- the inode to writedefault void writeNewInode(MutableInode<?> inode)
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.inode
- the inode to writedefault InodeStore.WriteBatch createWriteBatch()
supportsBatchWrite()
.InodeStore.WriteBatch
which can be used to perform a batched writedefault boolean supportsBatchWrite()
void clear()
void addChild(long parentId, String childName, Long childId)
parentId
- the parent idchildName
- the child namechildId
- the child inode iddefault void addChild(long parentId, InodeView child)
parentId
- the parent idchild
- the child inodevoid removeChild(long parentId, String name)
parentId
- the parent inode idname
- the child namedefault void close()
close
in interface AutoCloseable
close
in interface Closeable
Copyright © 2023. All Rights Reserved.