01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: TreeLocation.java,v 1.14.2.2 2008/01/07 15:14:16 cwl Exp $
07: */
08:
09: package com.sleepycat.je.tree;
10:
11: import com.sleepycat.je.utilint.DbLsn;
12:
13: /*
14: * TreeLocation is a cursor like object that keeps track of a location
15: * in a tree. It's used during recovery.
16: */
17: public class TreeLocation {
18: public BIN bin; // parent BIN for the target LN
19: public int index; // index of where the LN is or should go
20: public byte[] lnKey; // the key that represents this LN in this BIN
21: public long childLsn = DbLsn.NULL_LSN; // current LSN value in that slot.
22:
23: public void reset() {
24: bin = null;
25: index = -1;
26: lnKey = null;
27: childLsn = DbLsn.NULL_LSN;
28: }
29:
30: public String toString() {
31: StringBuffer sb = new StringBuffer("<TreeLocation bin=\"");
32: if (bin == null) {
33: sb.append("null");
34: } else {
35: sb.append(bin.getNodeId());
36: }
37: sb.append("\" index=\"");
38: sb.append(index);
39: sb.append("\" lnKey=\"");
40: sb.append(Key.dumpString(lnKey, 0));
41: sb.append("\" childLsn=\"");
42: sb.append(DbLsn.toString(childLsn));
43: sb.append("\">");
44: return sb.toString();
45: }
46: }
|