Scan the the log which is implemented by a series of log files.n
This log scan knows how to move across log file if it is positioned at
the boundary of a log file and needs to getNextRecord.
4 bytes - length of user data, i.e. N
8 bytes - long representing log instant
N bytes of supplied data
4 bytes - length of user data, i.e. N
readNextRecordLength Flag to indicate that the length of the next log record has been read by
currentLogFileHasUnflushedRecord.
This flag gets reset in two ways:
currentLogFileHasUnflushedRecord determines that the entire log
record is flushed and returns true.
getInstant() Return the log instant (as an integer) the scan is currently on - this is the log
instant of the log record that was returned by getNextRecord.
The length of the next record. Read from scan and set by
currentLogFileHasUnflushedRecord. This is used to retain the length of a
log record in the case currentLogFileHasUnflushedRecord reads the length
and determines that some bytes in the log record are not yet flushed.
Flag to indicate that the length of the next log record has been read by
currentLogFileHasUnflushedRecord.
This flag gets reset in two ways:
currentLogFileHasUnflushedRecord determines that the entire log
record is flushed and returns true. In this case getNextRecord reads and
returns the log record.
we switch log files --due to a partial log record at the end of an
old log file.
Get the log instant that is right after the record just retrived
INVALID_LOG_INSTANT if this is not a FORWARD scan or, norecord have been returned yet or the scan has completed.
Read a log record into the byte array provided. Resize the input
stream byte array if necessary.
the length of the data written into data, or -1 if the end of thescan has been reached. exception: StandardException - Standard Cloudscape error policy
returns true if there is partially writen log records before the crash
in the last log file. Partiall wrires are identified during forward
scans for log recovery.
Reset the scan to the given LogInstant.
Parameters: instant - the position to reset to exception: IOException - scan cannot access the log at the new position.