|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.store.raw.log.FlushedScan
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
Field Summary | |
(package private) long |
currentInstant
|
(package private) long |
currentLogFileFirstUnflushedPosition
|
(package private) long |
currentLogFileNumber
|
(package private) long |
firstUnflushed
|
(package private) long |
firstUnflushedFileNumber
|
(package private) long |
firstUnflushedFilePosition
|
(package private) static int |
LOG_REC_LEN_BYTE_LENGTH
|
(package private) LogToFile |
logFactory
|
(package private) int |
nextRecordLength
The length of the next record. |
(package private) boolean |
open
|
(package private) boolean |
readNextRecordLength
Flag to indicate that the length of the next log record has been read by currentLogFileHasUnflushedRecord. |
private StorageRandomAccessFile |
scan
|
Constructor Summary | |
FlushedScan(LogToFile logFactory,
long startAt)
|
Method Summary | |
void |
close()
Close the scan. |
private boolean |
currentLogFileHasUnflushedRecord()
|
long |
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. |
LogInstant |
getLogInstant()
Return the log instant the scan is currently on - this is the log instant of the log record that was returned by getNextRecord. |
long |
getLogRecordEnd()
Get the log instant that is right after the record just retrived |
LogRecord |
getNextRecord(ArrayInputStream input,
TransactionId tranId,
int groupmask)
Read a log record into the byte array provided. |
boolean |
isLogEndFuzzy()
returns true if there is partially writen log records before the crash in the last log file. |
private boolean |
positionToNextRecord()
|
void |
resetPosition(LogInstant instant)
Reset the scan to the given LogInstant. |
private void |
setCurrentLogFileFirstUnflushedPosition()
|
private void |
setFirstUnflushed()
|
private void |
switchLogFile()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private StorageRandomAccessFile scan
LogToFile logFactory
boolean open
long currentLogFileNumber
long currentLogFileFirstUnflushedPosition
long currentInstant
long firstUnflushed
long firstUnflushedFileNumber
long firstUnflushedFilePosition
static final int LOG_REC_LEN_BYTE_LENGTH
int nextRecordLength
boolean readNextRecordLength
Constructor Detail |
public FlushedScan(LogToFile logFactory, long startAt) throws StandardException
Method Detail |
public LogRecord getNextRecord(ArrayInputStream input, TransactionId tranId, int groupmask) throws StandardException
getNextRecord
in interface StreamLogScan
input
- the ArrayInputStream to put the log recordtranId
- if non-null, only log record that equals tranId
will be returned. If null, log records are not
filtered on transaction Id.groupmask
- if non-zero, only log record whose Loggable's group
value is included in the groupmask is returned.
groupmask can be a bit wise OR of many Loggable
groups. If zero, log records are not filtered on
the Loggable's group.
StandardException
- Standard Cloudscape error policypublic void resetPosition(LogInstant instant) throws java.io.IOException
resetPosition
in interface StreamLogScan
instant
- the position to reset to
java.io.IOException
- scan cannot access the log at the new position.public long getLogRecordEnd()
getLogRecordEnd
in interface StreamLogScan
public boolean isLogEndFuzzy()
isLogEndFuzzy
in interface StreamLogScan
public long getInstant()
getInstant
in interface StreamLogScan
public LogInstant getLogInstant()
getLogInstant
in interface StreamLogScan
public void close()
close
in interface StreamLogScan
private void setFirstUnflushed() throws StandardException, java.io.IOException
StandardException
java.io.IOException
private void setCurrentLogFileFirstUnflushedPosition() throws java.io.IOException
java.io.IOException
private void switchLogFile() throws StandardException
StandardException
private boolean currentLogFileHasUnflushedRecord() throws java.io.IOException
java.io.IOException
private boolean positionToNextRecord() throws StandardException, java.io.IOException
StandardException
java.io.IOException
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |