@NotThreadSafe public class MetadataSyncMergeJournalContext extends FileSystemMergeJournalContext
FileSystemMergeJournalContext
used in MetadataSync (InodeSyncStream).
This journal context never enforces a synchronous journal flush but only appends the journals
into the async journal writer. Metadata sync creates a bunch of inodes and with
PropertyKey.MASTER_FILE_SYSTEM_MERGE_INODE_JOURNALS
enabled,
journals are committed as long as an inode path lock is released, which creates too many
journal persistence/ raft RPCs and may impair the metadata sync performance.
Hence, this class only flushes journals async on flush() and close() and the underlying
journals in the async journal writer will be committed when the underlying JournalContext
gets closed.
Each metadata sync thread should have its own MetadataSyncMergeJournalContext
instance.mJournalEntryMerger
Constructor and Description |
---|
MetadataSyncMergeJournalContext(JournalContext journalContext,
JournalEntryMerger journalEntryMerger)
Constructs a
MetadataSyncMergeJournalContext . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush()
Merges all journals and then flushes them.
|
JournalEntryMerger |
getMerger() |
append, appendMergedJournals, getUnderlyingJournalContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
public MetadataSyncMergeJournalContext(JournalContext journalContext, JournalEntryMerger journalEntryMerger)
MetadataSyncMergeJournalContext
.journalContext
- the journal context to wrapjournalEntryMerger
- the merger which merges multiple journal entries into onepublic void flush()
FileSystemMergeJournalContext
flush
in interface JournalContext
flush
in class FileSystemMergeJournalContext
public void close()
close
in interface JournalContext
close
in interface Closeable
close
in interface AutoCloseable
close
in class FileSystemMergeJournalContext
public JournalEntryMerger getMerger()
Copyright © 2023. All Rights Reserved.