@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 |
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.
|
alluxio.master.journal.ufs.UfsJournalCheckpointWriter |
getCheckpointWriter(long checkpointSequenceNumber) |
protected static UnderFileSystemConfiguration |
getJournalUfsConf() |
URI |
getLocation() |
URI |
getLogDir() |
long |
getNextSequenceNumberToCheckpoint() |
long |
getNextSequenceNumberToWrite() |
long |
getQuietPeriodMs() |
UfsJournalReader |
getReader(boolean readIncompleteLogs) |
boolean |
isFormatted() |
void |
losePrimacy()
Transitions the journal from primary to secondary mode.
|
void |
start()
Starts the journal in secondary mode.
|
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 sinksprotected 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 losePrimacy() 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 void format() throws IOException
IOException
public void checkpoint() throws IOException
IOException
public URI getLogDir()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.