@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 secondary 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 secondary 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) |
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 secondary 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()
public URI getLocation()
getLocation
in interface Journal
public void flush() throws IOException, JournalClosedException
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() throws IOException
IOException
public void gainPrimacy() throws IOException
IOException
public void signalLosePrimacy()
awaitLosePrimacy()
must be called afterwards to complete the transition
from primary.public void awaitLosePrimacy() throws IOException
signalLosePrimacy()
to finish the transition from primary.IOException
public void suspend() throws IOException
IOException
public CatchupFuture catchup(long sequence) throws IOException
sequence
- sequence to catch upIOException
public void resume() throws IOException
IOException
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() throws IOException
IOException
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() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.