@ThreadSafe public class UfsJournal extends Object implements Journal
Modifier and Type | Field and Description |
---|---|
static long |
UNKNOWN_SEQUENCE_NUMBER
This is set to Long.MAX_VALUE such that the current log can be sorted after any other
completed logs.
|
static String |
VERSION
The journal version.
|
Constructor and Description |
---|
UfsJournal(URI location,
Master master,
long quietPeriodMs,
java.util.function.Supplier<Set<JournalSink>> journalSinks)
Creates a new instance of
UfsJournal . |
Modifier and Type | Method and Description |
---|---|
void |
awaitLosePrimacy()
Transitions the journal from primary to standby mode.
|
CatchupFuture |
catchup(long sequence)
Initiates catching up of the journal up to given sequence.
|
void |
checkpoint()
Creates a checkpoint in this ufs journal.
|
void |
close() |
JournalContext |
createJournalContext() |
void |
flush()
Flushes the journal.
|
void |
format()
Formats the journal.
|
void |
gainPrimacy()
Transitions the journal from standby to primary mode.
|
UfsJournalCheckpointThread.CatchupState |
getCatchupState() |
alluxio.master.journal.ufs.UfsJournalCheckpointWriter |
getCheckpointWriter(long checkpointSequenceNumber) |
static UnderFileSystemConfiguration |
getJournalUfsConf() |
URI |
getLocation() |
URI |
getLogDir() |
long |
getNextSequenceNumberToCheckpoint() |
long |
getNextSequenceNumberToWrite() |
long |
getQuietPeriodMs() |
UfsJournalReader |
getReader(boolean readIncompleteLogs) |
protected void |
init() |
boolean |
isFormatted() |
boolean |
isWritable() |
void |
resume()
Resumes the journal.
|
void |
signalLosePrimacy()
Notifies this journal that it is no longer primary.
|
void |
start()
Starts the journal in standby mode.
|
void |
suspend()
Suspends applying this journal until resumed.
|
String |
toString() |
public static final long UNKNOWN_SEQUENCE_NUMBER
public static final String VERSION
public UfsJournal(URI location, Master master, long quietPeriodMs, java.util.function.Supplier<Set<JournalSink>> journalSinks)
UfsJournal
.location
- the location for this journalmaster
- the master to managequietPeriodMs
- the amount of time to wait to pass without seeing a new journal entry when
gaining primacyjournalSinks
- a supplier for journal sinkspublic static UnderFileSystemConfiguration getJournalUfsConf()
protected void init()
public URI getLocation()
getLocation
in interface Journal
public void flush() throws IOException, JournalClosedException
AsyncJournalWriter
and no direct access to the UfsJournalLogWriter
.IOException
JournalClosedException
public JournalContext createJournalContext() throws UnavailableException
createJournalContext
in interface Journal
UnavailableException
- if a context cannot be created because the journal has been
closed.public void start()
public void gainPrimacy() throws IOException
IOException
public void signalLosePrimacy()
awaitLosePrimacy()
must be called afterwards to complete the transition
from primary.public void awaitLosePrimacy()
signalLosePrimacy()
to finish the transition from primary.public void suspend()
public CatchupFuture catchup(long sequence)
sequence
- sequence to catch uppublic void resume()
public long getQuietPeriodMs()
public UfsJournalReader getReader(boolean readIncompleteLogs)
readIncompleteLogs
- whether the reader should read the latest incomplete logpublic alluxio.master.journal.ufs.UfsJournalCheckpointWriter getCheckpointWriter(long checkpointSequenceNumber) throws IOException
checkpointSequenceNumber
- the next sequence number after the checkpointIOException
public long getNextSequenceNumberToWrite()
public long getNextSequenceNumberToCheckpoint() throws IOException
IOException
public boolean isFormatted()
public boolean isWritable()
public void format() throws IOException
IOException
public void checkpoint() throws IOException
IOException
public UfsJournalCheckpointThread.CatchupState getCatchupState()
public URI getLogDir()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2023. All Rights Reserved.