|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activeio.journal.howl.HowlJournal
public class HowlJournal
An implementation of the Journal interface using a HOWL logger. This is is a thin wrapper around a HOWL logger. This implementation can be used to write records but not to retreive them yet. Once the HOWL logger implements the methods needed to retreive previously stored records, this class can be completed.
| Constructor Summary | |
|---|---|
HowlJournal(Configuration configuration)
|
|
| Method Summary | |
|---|---|
void |
close()
Close the Journal. |
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 location)
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 recordLocator,
boolean force)
Informs the journal that all the journal space up to the location is no longer
needed and can be reclaimed for reuse. |
RecordLocation |
write(Packet packet,
boolean sync)
Writes a Packet of data to the journal. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HowlJournal(Configuration configuration)
throws InvalidFileSetException,
LogConfigurationException,
InvalidLogBufferException,
java.lang.ClassNotFoundException,
java.io.IOException,
java.lang.InterruptedException
InvalidFileSetException
LogConfigurationException
InvalidLogBufferException
java.lang.ClassNotFoundException
java.io.IOException
java.lang.InterruptedException| Method Detail |
|---|
public RecordLocation write(Packet packet,
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.org.apache.activeio.journal.Journal#write(byte[], boolean)
public void setMark(RecordLocation recordLocator,
boolean force)
throws InvalidRecordLocationException,
java.io.IOException
Journallocation is no longer
needed and can be reclaimed for reuse.
setMark in interface JournalrecordLocator - the location of the record to mark. All record locations before the marked
location will no longger be vaild.force - if this call should block until the mark is set on the journal.
InvalidRecordLocationException - if location parameter is out of range.
It cannot be a location that is before the current mark.
java.io.IOException - if the record could not be read.org.apache.activeio.journal.Journal#setMark(org.codehaus.activemq.journal.RecordLocation, boolean)public RecordLocation getMark()
Journal
getMark in interface JournalJournal.getMark()
public void close()
throws java.io.IOException
Journal
close in interface Journaljava.io.IOException - if an error occurs while the journal is being closed.Journal.close()public void setJournalEventListener(JournalEventListener eventListener)
JournalJournalEventListener that will receive notifications from the Journal.
setJournalEventListener in interface JournaleventListener - object that will receive journal events.org.apache.activeio.journal.Journal#setJournalEventListener(org.codehaus.activemq.journal.JournalEventListener)
public RecordLocation getNextRecordLocation(RecordLocation lastLocation)
throws InvalidRecordLocationException
Journallocation that
is in the journal.
getNextRecordLocation in interface JournallastLocation - the reference location the is used to find the next location.
To get the oldest location available in the journal, location
should be set to null.
InvalidRecordLocationException - if location parameter is out of range.
It cannot be a location that is before the current mark.org.apache.activeio.journal.Journal#getNextRecordLocation(org.codehaus.activemq.journal.RecordLocation)
public Packet read(RecordLocation location)
throws InvalidRecordLocationException,
java.io.IOException
Journal
read in interface Journallocation - is where to read the record from.
location.
InvalidRecordLocationException - if location parameter is out of range.
It cannot be a location that is before the current mark.
java.io.IOException - if the record could not be read.org.apache.activeio.journal.Journal#read(org.codehaus.activemq.journal.RecordLocation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||