public final class JournalImpl extends Object implements Journal
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PACKET_SIZE |
static int |
DEFAULT_POOL_SIZE |
| Constructor and Description |
|---|
JournalImpl(File logDirectory) |
JournalImpl(File logDirectory,
int logFileCount,
int logFileSize) |
JournalImpl(File logDirectory,
int logFileCount,
int logFileSize,
File archiveDirectory) |
JournalImpl(LogFileManager logFile) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Deprecated.
@see #dispose()
|
void |
dispose() |
int |
getInitialLogFileSize() |
File |
getLogDirectory() |
RecordLocation |
getMark()
Obtains the mark that was set in the Journal.
|
RecordLocation |
getNextRecordLocation(RecordLocation lastLocation)
Allows you to get the next RecordLocation after the
location that
is in the journal. |
protected IOException |
handleExecutionException(ExecutionException e) |
Packet |
read(RecordLocation l)
Reads a previously written record from the journal.
|
void |
setJournalEventListener(JournalEventListener eventListener)
Registers a
JournalEventListener that will receive notifications from the Journal. |
void |
setMark(RecordLocation l,
boolean force)
Informs the journal that all the journal space up to the
location is no longer
needed and can be reclaimed for reuse. |
String |
toString() |
RecordLocation |
write(Packet data,
boolean sync)
Writes a
Packet of data to the journal. |
public static final int DEFAULT_POOL_SIZE
public static final int DEFAULT_PACKET_SIZE
public JournalImpl(File logDirectory) throws IOException
IOExceptionpublic JournalImpl(File logDirectory, int logFileCount, int logFileSize) throws IOException
IOExceptionpublic JournalImpl(File logDirectory, int logFileCount, int logFileSize, File archiveDirectory) throws IOException
IOExceptionpublic JournalImpl(LogFileManager logFile)
public RecordLocation write(Packet data, boolean sync) throws IOException
JournalPacket of data to the journal. If sync
is true, then this call blocks until the data has landed on the physical
disk. Otherwise, this enqueues the write request and returns.write in interface Journalsync - - If this call should block until the data lands on disk.IOException - if the write failed.public void setMark(RecordLocation l, boolean force) throws InvalidRecordLocationException, IOException
Journallocation is no longer
needed and can be reclaimed for reuse.setMark in interface JournalrecordLocator - force - InvalidRecordLocationExceptionIOExceptionInterruptedExceptionpublic RecordLocation getMark()
JournalgetMark in interface JournalJournal.read(RecordLocation location);public RecordLocation getNextRecordLocation(RecordLocation lastLocation) throws IOException, InvalidRecordLocationException
Journallocation that
is in the journal.getNextRecordLocation in interface JournallastLocation - IOExceptionInvalidRecordLocationExceptionprotected IOException handleExecutionException(ExecutionException e) throws IOException
IOExceptionpublic Packet read(RecordLocation l) throws IOException, InvalidRecordLocationException
Journalread in interface Journallocation - InvalidRecordLocationExceptionIOExceptionpublic void setJournalEventListener(JournalEventListener eventListener)
JournalJournalEventListener that will receive notifications from the Journal.setJournalEventListener in interface JournaleventListener - object that will receive journal events.public void close()
throws IOException
Journalclose in interface JournalIOException - if an error occurs while the journal is being closed.public void dispose()
public File getLogDirectory()
public int getInitialLogFileSize()
Copyright © 2005–2019. All rights reserved.