|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.howl.log.LogRecord
public class LogRecord
LogRecord class used by Logger.replay().
This class may be extended by applications to provide Java Bean mappings for application data fields within the record.
Field Summary | |
---|---|
byte[] |
data
byte[] containing unparsed record data. |
java.nio.ByteBuffer |
dataBuffer
ByteBuffer wrapper for the data byte[]. |
protected byte[][] |
fields
array of individual record fields as passed to Logger.put(byte[][]) |
long |
key
log key associated with this LogRecord. |
short |
length
length of the data record. |
long |
tod
currentTimeMillis the log buffer containing this record was initialized. |
short |
type
type of data record. |
Constructor Summary | |
---|---|
LogRecord(int size)
constructs an instance of LogRecord with a byte[] of size data. |
Method Summary | |
---|---|
int |
capacity()
|
protected LogRecord |
get(org.objectweb.howl.log.LogBuffer lb)
protected method to copy next logical record from the LogBuffer specified by the callers lb parameter. |
byte[][] |
getFields()
Parse record data into a byte[][] that is equivalent to the one passed to Logger.put(byte[][]). |
boolean |
isCTRL()
Return true if the current record is a control record. |
boolean |
isEOB()
Return true if current record is an EOB type control record. |
void |
setFilterCtrlRecords(boolean filterCtrlRecords)
Set the filterCtrlRecords member |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public short type
USER data records have a type == 0.
Logger control record types are defined by LogRecordType.
LogRecordType
public short length
public long key
protected byte[][] fields
getFields()
public byte[] data
public long tod
LogBuffers normally flush to disk in something less than 50 ms, so this tod should be a pretty close approximation of the time the record was generated.
public java.nio.ByteBuffer dataBuffer
Constructor Detail |
---|
public LogRecord(int size)
size
- initial size of data buffer.
the get() method will reallocate the data buffer to accomdate larger records.
Method Detail |
---|
public boolean isEOB()
public boolean isCTRL()
public void setFilterCtrlRecords(boolean filterCtrlRecords)
filterCtrlRecords
- public final int capacity()
protected LogRecord get(org.objectweb.howl.log.LogBuffer lb) throws InvalidLogBufferException
Following the call to get() the number of data bytes transferred into this LogRecord's data buffer is available in LogRecord.length. The LogRecord.dataBuffer.limit is also set to the number of bytes transferred.
Sets LogRecord.type to LogRecordType.EOB if the position of this LogBuffer is at or beyond bytes used.
Sets the limit of this LogRecord to the number of bytes in the logical record being retreived.
LogBuffer.position() is unchanged if any exception is thrown.
lb
- LogBuffer to get the next logical record from.
InvalidLogBufferException
- if the size of the data record exceeds the bytes used for the buffer.LogRecordType
public byte[][] getFields()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |