| java.lang.Object org.apache.derby.impl.store.raw.log.Scan
Scan | public class Scan implements StreamLogScan(Code) | | 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
|
Constructor Summary | |
public | Scan(LogToFile logFactory, long startAt, LogInstant stopAt, byte direction) For backward scan, we expect a scan positioned at the end of the next log record.
For forward scan, we expect a scan positioned at the beginning of the next log record.
For forward flushed scan, we expect stopAt to be the instant for the
first not-flushed log record. |
Method Summary | |
public void | close() Close the scan. | public 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. | public 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. | public long | getLogRecordEnd() Return the log instant at the end of the log record on the current
LogFile in the form of a log instant.
After the scan has been closed, the end of the last log record will be
returned except when the scan ended in an empty log file. | public LogRecord | getNextRecord(ArrayInputStream input, TransactionId tranId, int groupmask) Read the next log record.
Switching log to a previous log file if necessary,
Resize the input stream byte array if necessary. | public boolean | isLogEndFuzzy() returns true if there is partially writen log records before the crash
in the last log file. | public void | resetPosition(LogInstant instant) Reset the scan to the given LogInstant. |
BACKWARD | final public static byte BACKWARD(Code) | | |
BACKWARD_FROM_LOG_END | final public static byte BACKWARD_FROM_LOG_END(Code) | | |
FORWARD | final public static byte FORWARD(Code) | | |
Scan | public Scan(LogToFile logFactory, long startAt, LogInstant stopAt, byte direction) throws IOException, StandardException(Code) | | For backward scan, we expect a scan positioned at the end of the next log record.
For forward scan, we expect a scan positioned at the beginning of the next log record.
For forward flushed scan, we expect stopAt to be the instant for the
first not-flushed log record. Like any forward scan, we expect a scan
positioned at the beginning of the next log record.
exception: StandardException - Standard Cloudscape error policy exception: IOException - cannot access the log at the new position. |
close | public void close()(Code) | | Close the scan.
|
getInstant | public long getInstant()(Code) | | 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.
|
getLogInstant | public LogInstant getLogInstant()(Code) | | Return the log instant the scan is currently on - this is the log
instant of the log record that was returned by getNextRecord.
|
getLogRecordEnd | public long getLogRecordEnd()(Code) | | Return the log instant at the end of the log record on the current
LogFile in the form of a log instant.
After the scan has been closed, the end of the last log record will be
returned except when the scan ended in an empty log file. In that
case, the start of this empty log file will be returned. (This is
done to make sure new log records are inserted into the newest log
file.)
|
isLogEndFuzzy | public boolean isLogEndFuzzy()(Code) | | returns true if there is partially writen log records before the crash
in the last log file. Partiall wrires are identified during forward
redo scans for log recovery.
|
|
|