@NotThreadSafe public class UfsJournalSystem extends AbstractJournalSystem
JournalSystem.Builder, JournalSystem.Mode
Constructor and Description |
---|
UfsJournalSystem(URI base,
long quietTimeMs)
Creates a UFS journal system with the specified base location.
|
Modifier and Type | Method and Description |
---|---|
void |
checkpoint()
Creates a checkpoint in the primary master journal system.
|
UfsJournal |
createJournal(Master master)
Creates a journal for the given state machine.
|
void |
format()
Formats the journal system.
|
void |
gainPrimacy()
Transitions the journal to primary mode.
|
boolean |
isEmpty()
Returns whether the journal is formatted and has not had any entries written to it yet.
|
boolean |
isFormatted() |
void |
losePrimacy()
Transitions the journal to secondary mode.
|
void |
startInternal()
Starts the journal system.
|
void |
stopInternal()
Stops the journal system.
|
addJournalSink, getJournalSinks, removeJournalSink, start, stop
public UfsJournalSystem(URI base, long quietTimeMs)
base
- the base location for journals created by this factoryquietTimeMs
- before upgrading from SECONDARY to PRIMARY mode, the journal will wait until
this duration has passed without any journal entries being written.public UfsJournal createJournal(Master master)
JournalSystem
Journaled#processJournalEntry(JournalEntry)
and
Journaled.resetState()
to keep the state machine's state in sync with
the entries written to the journal.master
- the master to create the journal forJournal
public void gainPrimacy()
JournalSystem
public void losePrimacy()
JournalSystem
public void startInternal() throws IOException
AbstractJournalSystem
startInternal
in class AbstractJournalSystem
IOException
public void stopInternal()
AbstractJournalSystem
stopInternal
in class AbstractJournalSystem
public boolean isFormatted() throws IOException
IOException
public boolean isEmpty()
JournalSystem
public void format() throws IOException
JournalSystem
IOException
public void checkpoint() throws IOException
JournalSystem
IOException
Copyright © 2023. All Rights Reserved.