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 17 20 public class CheckpointFileReader extends FileReader { 21 22 private boolean isRoot; 23 private boolean isCheckpointEnd; 24 private boolean isCheckpointStart; 25 26 29 public CheckpointFileReader(EnvironmentImpl env, 30 int readBufferSize, 31 boolean forward, 32 long startLsn, 33 long finishLsn, 34 long endOfFileLsn) 35 throws IOException , DatabaseException { 36 37 super(env, readBufferSize, forward, startLsn, 38 null, endOfFileLsn, finishLsn); 39 } 40 41 44 protected boolean isTargetEntry(byte logEntryTypeNumber, 45 byte logEntryTypeVersion) { 46 boolean isTarget = false; 47 isRoot = false; 48 isCheckpointEnd = false; 49 isCheckpointStart = false; 50 if (LogEntryType.LOG_CKPT_END.equalsType(logEntryTypeNumber, 51 logEntryTypeVersion)) { 52 isTarget = true; 53 isCheckpointEnd = true; 54 } else if (LogEntryType.LOG_CKPT_START.equalsType(logEntryTypeNumber, 55 logEntryTypeVersion)) { 56 isTarget = true; 57 isCheckpointStart = true; 58 } else if (LogEntryType.LOG_ROOT.equalsType(logEntryTypeNumber, 59 logEntryTypeVersion)) { 60 isTarget = true; 61 isRoot = true; 62 } 63 return isTarget; 64 } 65 66 69 protected boolean processEntry(ByteBuffer entryBuffer) 70 throws DatabaseException { 71 72 73 return true; 74 } 75 76 79 public boolean isRoot() { 80 return isRoot; 81 } 82 83 86 public boolean isCheckpointEnd() { 87 return isCheckpointEnd; 88 } 89 90 93 public boolean isCheckpointStart() { 94 return isCheckpointStart; 95 } 96 } 97 | Popular Tags |