|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.activeio.journal.active.JournalImpl
A high speed Journal implementation. Inspired by the ideas of the Howl project but tailored to the needs of ActiveMQ.
This Journal provides the following features:
| Field Summary | |
static int |
DEFAULT_PACKET_SIZE
|
static int |
DEFAULT_POOL_SIZE
|
| Constructor Summary | |
JournalImpl(java.io.File logDirectory)
|
|
JournalImpl(java.io.File logDirectory,
int logFileCount,
int logFileSize)
|
|
JournalImpl(LogFileManager logFile)
|
|
| Method Summary | |
void |
close()
Close the Journal. |
void |
dispose()
This method should not throw any exceptions. |
int |
getInitialLogFileSize()
|
java.io.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. |
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. |
java.lang.String |
toString()
|
RecordLocation |
write(Packet data,
boolean sync)
Writes a Packet of data to the journal. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_POOL_SIZE
public static final int DEFAULT_PACKET_SIZE
| Constructor Detail |
public JournalImpl(java.io.File logDirectory)
throws java.io.IOException
public JournalImpl(java.io.File logDirectory,
int logFileCount,
int logFileSize)
throws java.io.IOException
public JournalImpl(LogFileManager logFile)
| Method Detail |
public RecordLocation write(Packet data,
boolean sync)
throws java.io.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.
java.io.IOException - if the write failed.
public void setMark(RecordLocation l,
boolean force)
throws InvalidRecordLocationException,
java.io.IOException
Journallocation is no longer
needed and can be reclaimed for reuse.
setMark in interface Journalforce - l - the location of the record to mark. All record locations before the marked
location will no longger be vaild.
InvalidRecordLocationException
java.io.IOException
java.lang.InterruptedExceptionpublic RecordLocation getMark()
Journal
getMark in interface Journalread(RecordLocation location);
public RecordLocation getNextRecordLocation(RecordLocation lastLocation)
throws java.io.IOException,
InvalidRecordLocationException
Journallocation that
is in the journal.
getNextRecordLocation in interface JournallastLocation -
java.io.IOException
InvalidRecordLocationException
public Packet read(RecordLocation l)
throws java.io.IOException,
InvalidRecordLocationException
Journal
read in interface Journall - is where to read the record from.
InvalidRecordLocationException
java.io.IOExceptionpublic 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 java.io.IOException
Journal
close in interface Journaljava.io.IOException - if an error occurs while the journal is being closed.public void dispose()
Disposable
dispose in interface Disposablepublic java.io.File getLogDirectory()
public int getInitialLogFileSize()
public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||