1 8 9 package com.sleepycat.je.log; 10 11 import java.io.IOException ; 12 import java.nio.ByteBuffer ; 13 14 import com.sleepycat.je.DatabaseException; 15 import com.sleepycat.je.dbi.EnvironmentImpl; 16 import com.sleepycat.je.log.entry.LogEntry; 17 import com.sleepycat.je.utilint.DbLsn; 18 19 22 public class TestUtilLogReader extends FileReader { 23 24 private LogEntryType entryType; 25 private LogEntry entry; 26 27 public TestUtilLogReader(EnvironmentImpl env) 28 throws IOException , DatabaseException { 29 30 super(env, 31 4096, 32 true, 33 DbLsn.NULL_LSN, 34 null, 35 DbLsn.NULL_LSN, 36 DbLsn.NULL_LSN); 37 } 38 39 public TestUtilLogReader(EnvironmentImpl env, 40 int readBufferSize, 41 boolean forward, 42 long startLsn, 43 Long singleFileNumber, 44 long endOfFileLsn, 45 long finishLsn) 46 throws IOException , DatabaseException { 47 48 super(env, 49 readBufferSize, 50 forward, 51 startLsn, 52 singleFileNumber, 53 endOfFileLsn, 54 finishLsn); 55 } 56 57 public LogEntryType getEntryType() { 58 return entryType; 59 } 60 61 public LogEntry getEntry() { 62 return entry; 63 } 64 65 protected boolean isTargetEntry(byte logEntryTypeNumber, 66 byte logEntryTypeVersion) { 67 return true; 68 } 69 70 protected boolean processEntry(ByteBuffer entryBuffer) 71 throws DatabaseException { 72 73 entryType = LogEntryType.findType 74 (currentEntryTypeNum, currentEntryTypeVersion); 75 entry = entryType.getSharedLogEntry(); 76 entry.readEntry 77 (entryBuffer, currentEntrySize, currentEntryTypeVersion, true); 78 return true; 79 } 80 } 81 | Popular Tags |