1 8 9 package com.sleepycat.je.log; 10 11 import java.io.IOException ; 12 import java.util.HashSet ; 13 import java.util.Set ; 14 import java.util.StringTokenizer ; 15 16 import com.sleepycat.je.DatabaseException; 17 import com.sleepycat.je.dbi.EnvironmentImpl; 18 import com.sleepycat.je.utilint.DbLsn; 19 20 23 public abstract class DumpFileReader extends FileReader { 24 25 26 private Set targetEntryTypes; 27 28 29 protected Set targetTxnIds; 30 31 32 protected boolean verbose; 33 34 37 public DumpFileReader(EnvironmentImpl env, 38 int readBufferSize, 39 long startLsn, 40 long finishLsn, 41 String entryTypes, 42 String txnIds, 43 boolean verbose) 44 throws IOException , DatabaseException { 45 46 super(env, 47 readBufferSize, 48 true, startLsn, 50 null, DbLsn.NULL_LSN, finishLsn); 54 55 targetEntryTypes = new HashSet (); 56 if (entryTypes != null) { 57 StringTokenizer tokenizer = new StringTokenizer (entryTypes, ","); 58 while (tokenizer.hasMoreTokens()) { 59 String typeString = (String ) tokenizer.nextToken(); 60 targetEntryTypes.add(new Byte (typeString.trim())); 61 } 62 } 63 64 targetTxnIds = new HashSet (); 65 if (txnIds != null) { 66 StringTokenizer tokenizer = new StringTokenizer (txnIds, ","); 67 while (tokenizer.hasMoreTokens()) { 68 String txnIdString = (String ) tokenizer.nextToken(); 69 targetTxnIds.add(new Long (txnIdString.trim())); 70 } 71 } 72 this.verbose = verbose; 73 } 74 75 79 protected boolean isTargetEntry(byte logEntryTypeNumber, 80 byte logEntryTypeVersion) { 81 if (targetEntryTypes.size() == 0) { 82 83 return true; 84 } else { 85 return targetEntryTypes.contains(new Byte (logEntryTypeNumber)); 86 } 87 } 88 89 public void summarize() { 90 } 91 } 92 | Popular Tags |