KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > recovery > RecoveryInfo


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: RecoveryInfo.java,v 1.25 2006/10/30 21:14:22 bostic Exp $
7  */

8
9 package com.sleepycat.je.recovery;
10
11 import com.sleepycat.je.utilint.DbLsn;
12
13 /**
14  * RecoveryInfo keeps information about recovery processing.
15  */

16 public class RecoveryInfo {
17
18     /* Locations found during recovery. */
19     public long lastUsedLsn = DbLsn.NULL_LSN; // location of last entry
20
public long nextAvailableLsn = DbLsn.NULL_LSN; // EOF, location of first unused spot
21
public long firstActiveLsn = DbLsn.NULL_LSN;
22     public long checkpointStartLsn = DbLsn.NULL_LSN;
23     public long checkpointEndLsn = DbLsn.NULL_LSN;
24     public long useRootLsn = DbLsn.NULL_LSN;
25
26     /*
27      * Represents the first CkptStart following the CkptEnd. It is a CkptStart
28      * with no CkptEnd, and is used for counting provisional INs obsolete.
29      */

30     public long partialCheckpointStartLsn = DbLsn.NULL_LSN;
31
32     // Checkpoint record used for this recovery.
33
public CheckpointEnd checkpointEnd;
34
35     // Ids
36
public long useMaxNodeId;
37     public int useMaxDbId;
38     public long useMaxTxnId;
39
40     // num nodes read
41
public int numMapINs;
42     public int numOtherINs;
43     public int numBinDeltas;
44     public int numDuplicateINs;
45
46     // ln processing
47
public int lnFound;
48     public int lnNotFound;
49     public int lnInserted;
50     public int lnReplaced;
51
52     // FileReader behavior
53
public int nRepeatIteratorReads;
54
55     public String JavaDoc toString() {
56         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
57         sb.append("Recovery Info");
58         appendLsn(sb, " lastUsed=", lastUsedLsn);
59         appendLsn(sb, " nextAvail=", nextAvailableLsn);
60         appendLsn(sb, " ckptStart=", checkpointStartLsn);
61         appendLsn(sb, " firstActive=", firstActiveLsn);
62         appendLsn(sb, " ckptEnd=", checkpointEndLsn);
63         appendLsn(sb, " useRoot=", useRootLsn);
64         sb.append(checkpointEnd).append(">");
65         sb.append(" useMaxNodeId=").append(useMaxNodeId);
66         sb.append(" useMaxDbId=").append(useMaxDbId);
67         sb.append(" useMaxTxnId=").append(useMaxTxnId);
68         sb.append(" numMapINs=").append(numMapINs);
69         sb.append(" numOtherINs=").append(numOtherINs);
70         sb.append(" numBinDeltas=").append(numBinDeltas);
71         sb.append(" numDuplicateINs=").append(numDuplicateINs);
72         sb.append(" lnFound=").append(lnFound);
73         sb.append(" lnNotFound=").append(lnNotFound);
74         sb.append(" lnInserted=").append(lnInserted);
75         sb.append(" lnReplaced=").append(lnReplaced);
76         sb.append(" nRepeatIteratorReads=").append(nRepeatIteratorReads);
77         return sb.toString();
78     }
79
80     private void appendLsn(StringBuffer JavaDoc sb, String JavaDoc name, long lsn) {
81         if (lsn != DbLsn.NULL_LSN) {
82             sb.append(name).append(DbLsn.getNoFormatString(lsn));
83         }
84     }
85 }
86
Popular Tags