01: /*
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: BINDeltaLogEntry.java,v 1.23.2.3 2008/01/07 15:14:13 cwl Exp $
07: */
08:
09: package com.sleepycat.je.log.entry;
10:
11: import com.sleepycat.je.DatabaseException;
12: import com.sleepycat.je.dbi.DatabaseId;
13: import com.sleepycat.je.dbi.EnvironmentImpl;
14: import com.sleepycat.je.tree.BINDelta;
15: import com.sleepycat.je.tree.IN;
16:
17: /**
18: * A BINDeltaLogEntry knows how to create a whole BIN from a delta entry.
19: */
20: public class BINDeltaLogEntry extends SingleItemEntry implements
21: INContainingEntry {
22:
23: /**
24: * @param logClass
25: */
26: public BINDeltaLogEntry(Class logClass) {
27: super (logClass);
28: }
29:
30: /*
31: * @see com.sleepycat.je.log.entry.INContainingEntry#getIN()
32: */
33: public IN getIN(EnvironmentImpl env) throws DatabaseException {
34:
35: BINDelta delta = (BINDelta) getMainItem();
36: return delta.reconstituteBIN(env);
37: }
38:
39: /*
40: * @see com.sleepycat.je.log.entry.INContainingEntry#getDbId()
41: */
42: public DatabaseId getDbId() {
43:
44: BINDelta delta = (BINDelta) getMainItem();
45: return delta.getDbId();
46: }
47:
48: /**
49: * @return the LSN that represents this IN. For this BINDelta, it's
50: * the last full version.
51: */
52: public long getLsnOfIN(long lastReadLsn) {
53:
54: BINDelta delta = (BINDelta) getMainItem();
55: return delta.getLastFullLsn();
56: }
57: }
|