public class InodeTreePersistentState extends Object implements Journaled
Constructor and Description |
---|
InodeTreePersistentState(InodeStore inodeStore,
InodeLockManager lockManager,
TtlBucketList ttlBucketList) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyAndJournal
public InodeTreePersistentState(InodeStore inodeStore, InodeLockManager lockManager, TtlBucketList ttlBucketList)
inodeStore
- file store which holds inode metadatalockManager
- manager for inode locksttlBucketList
- reference to the ttl bucket list so that the list can be updated when the
inode tree is modifiedpublic boolean isOperationComplete(@Nullable OperationId opId)
opId
- the operation idtrue
if given op is marked completepublic void cacheOperation(@Nullable OperationId opId)
opId
- the operation idpublic Set<Long> getReplicationLimitedFileIds()
public InodeDirectory getRoot()
public long getInodeCount()
public Map<Long,Number> getFileSizeHistogram()
public Set<Long> getToBePersistedIds()
PersistenceState.TO_BE_PERSISTED
public TtlBucketList getTtlBuckets()
public void applyAndJournal(java.util.function.Supplier<JournalContext> context, File.DeleteFileEntry entry)
context
- journal context supplierentry
- delete file entrypublic long applyAndJournal(java.util.function.Supplier<JournalContext> context, File.NewBlockEntry entry)
context
- journal context supplierentry
- new block entrypublic void applyAndJournal(java.util.function.Supplier<JournalContext> context, File.RenameEntry entry)
context
- journal context supplierentry
- rename entrypublic void applyAndJournal(java.util.function.Supplier<JournalContext> context, File.SetAclEntry entry)
context
- journal context supplierentry
- set acl entrypublic void applyAndJournal(java.util.function.Supplier<JournalContext> context, File.UpdateInodeEntry entry)
context
- journal context supplierentry
- update inode entrypublic void applyAndJournal(java.util.function.Supplier<JournalContext> context, File.UpdateInodeDirectoryEntry entry)
context
- journal context supplierentry
- update inode directory entrypublic void applyAndJournal(java.util.function.Supplier<JournalContext> context, File.UpdateInodeFileEntry entry)
context
- journal context supplierentry
- update inode file entrypublic void applyAndJournal(java.util.function.Supplier<JournalContext> context, MutableInode<?> inode, String path)
context
- journal context supplierinode
- an inode to add and create a journal entry forpath
- path of the new inodepublic File.UpdateInodeEntry applyInodeAccessTime(long inodeId, long accessTime)
inodeId
- the id of the target inodeaccessTime
- the new value for last access timepublic boolean processJournalEntry(Journal.JournalEntry entry)
Journaled
processJournalEntry
in interface Journaled
entry
- the entry to applypublic void resetState()
Journaled
resetState
in interface Journaled
public void writeToCheckpoint(OutputStream output) throws IOException, InterruptedException
Checkpointed
InterruptedException
if they get
interrupted while running.writeToCheckpoint
in interface Checkpointed
writeToCheckpoint
in interface Journaled
output
- the output stream to write toIOException
InterruptedException
public void restoreFromCheckpoint(CheckpointInputStream input) throws IOException
Checkpointed
restoreFromCheckpoint
in interface Checkpointed
restoreFromCheckpoint
in interface Journaled
input
- an input stream with checkpoint dataIOException
public CloseableIterator<Journal.JournalEntry> getJournalEntryIterator()
getJournalEntryIterator
in interface JournalEntryIterable
CloseableIterator
that iterates all the journal entriespublic CheckpointName getCheckpointName()
getCheckpointName
in interface Checkpointed
Copyright © 2023. All Rights Reserved.