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
| Modifier and Type | Field and Description |
|---|---|
| public static final byte | |
| public static final byte | |
| private long | |
| private long | |
| private long | |
| public static final byte | |
| private boolean | |
| private long | |
| private LogToFile | |
| private StorageRandomAccessFile | |
| private byte | |
| private long |
| Access | Constructor and Description |
|---|---|
| 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. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public long | getInstant()
Implements org. 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()
Implements org. 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()
Implements org. Return the log instant at the end of the log record on the current LogFile in the form of a log instant. |
| public LogRecord | Returns: the next LogRecord, or null if the end of the scan has been reached.the ArrayInputStream to put the log record input, TransactionId if non-null, only log record that equals tranId
will be returned. If null, log records are not
filtered on transaction Id. tranId, int 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. groupmask)Implements org. Read the next log record. |
| private LogRecord | Returns: the previous LogRecord, or null if the end of the scan has been reached.Read the previous log record. |
| private LogRecord | Returns: the next LogRecord, or null if the end of the scan has been reached.Read the next log record. |
| public boolean | isLogEndFuzzy()
Implements org. returns true if there is partially writen log records before the crash in the last log file. |
| public void | resetPosition(LogInstant
the position to reset to instant)Implements org. Reset the scan to the given LogInstant. |
| BACKWARD | back to summary |
|---|---|
| public static final byte BACKWARD | |
| BACKWARD_FROM_LOG_END | back to summary |
|---|---|
| public static final byte BACKWARD_FROM_LOG_END | |
| currentInstant | back to summary |
|---|---|
| private long currentInstant | |
| currentLogFileLength | back to summary |
|---|---|
| private long currentLogFileLength | |
| currentLogFileNumber | back to summary |
|---|---|
| private long currentLogFileNumber | |
| FORWARD | back to summary |
|---|---|
| public static final byte FORWARD | |
| fuzzyLogEnd | back to summary |
|---|---|
| private boolean fuzzyLogEnd | |
| knownGoodLogEnd | back to summary |
|---|---|
| private long knownGoodLogEnd | |
| logFactory | back to summary |
|---|---|
| private LogToFile logFactory | |
| scan | back to summary |
|---|---|
| private StorageRandomAccessFile scan | |
| scanDirection | back to summary |
|---|---|
| private byte scanDirection | |
| stopAt | back to summary |
|---|---|
| private long stopAt | |
| Scan | back to summary |
|---|---|
| public Scan(LogToFile logFactory, long startAt, LogInstant stopAt, byte direction) throws IOException, StandardException 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.
| |
| close | back to summary |
|---|---|
| public void close() Implements org. Close the scan. | |
| getInstant | back to summary |
|---|---|
| public long getInstant() Implements org. 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 | back to summary |
|---|---|
| public LogInstant getLogInstant() Implements org. Return the log instant the scan is currently on - this is the log instant of the log record that was returned by getNextRecord.
| |
| getLogRecordEnd | back to summary |
|---|---|
| public long getLogRecordEnd() Implements org. 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.)
| |
| getNextRecord | back to summary |
|---|---|
| public LogRecord getNextRecord(ArrayInputStream input, TransactionId tranId, int groupmask) throws StandardException Implements org. Read the next log record. Switching log to a previous log file if necessary, Resize the input stream byte array if necessary.
| |
| getNextRecordBackward | back to summary |
|---|---|
| private LogRecord getNextRecordBackward(ArrayInputStream input, TransactionId tranId, int groupmask) throws StandardException, IOException, ClassNotFoundException Read the previous log record. Switching log to a previous log file if necessary, Resize the input stream byte array if necessary.
| |
| getNextRecordForward | back to summary |
|---|---|
| private LogRecord getNextRecordForward(ArrayInputStream input, TransactionId tranId, int groupmask) throws StandardException, IOException, ClassNotFoundException Read the next log record. Switching log to a previous log file if necessary, Resize the input stream byte array if necessary.
| |
| isLogEndFuzzy | back to summary |
|---|---|
| public boolean isLogEndFuzzy() Implements org. 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.
| |
| resetPosition | back to summary |
|---|---|
| public void resetPosition(LogInstant instant) throws IOException, StandardException Implements org. Reset the scan to the given LogInstant.
| |