Class Scan

  • All Implemented Interfaces:
    LogScan, StreamLogScan

    public class Scan
    extends java.lang.Object
    implements StreamLogScan
    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 Detail

      • currentLogFileNumber

        private long currentLogFileNumber
      • currentLogFileLength

        private long currentLogFileLength
      • knownGoodLogEnd

        private long knownGoodLogEnd
      • currentInstant

        private long currentInstant
      • stopAt

        private long stopAt
      • scanDirection

        private byte scanDirection
      • fuzzyLogEnd

        private boolean fuzzyLogEnd
    • Constructor Detail

      • Scan

        public Scan​(LogToFile logFactory,
                    long startAt,
                    LogInstant stopAt,
                    byte direction)
             throws java.io.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.
        Throws:
        StandardException - Standard Derby error policy
        java.io.IOException - cannot access the log at the new position.