01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: WriteLockInfo.java,v 1.14.2.3 2008/01/07 15:14:17 cwl Exp $
07: */
08:
09: package com.sleepycat.je.txn;
10:
11: import com.sleepycat.je.utilint.DbLsn;
12:
13: /*
14: * Lock and abort LSN kept for each write locked node. Allows us to log with
15: * the correct abort LSN.
16: */
17: public class WriteLockInfo {
18:
19: /*
20: * The original LSN. This is stored in the LN log entry. May be null if
21: * the node was created by this transaction.
22: */
23: long abortLsn = DbLsn.NULL_LSN;
24:
25: /*
26: * The original setting of the knownDeleted flag. It parallels abortLsn.
27: */
28: boolean abortKnownDeleted;
29:
30: /*
31: * Size of the original log entry, or zero if abortLsn is NULL_LSN or if
32: * the size is not known.
33: */
34: int abortLogSize;
35:
36: /*
37: * True if the node has never been locked before. Used so we can determine
38: * when to set abortLsn.
39: */
40: boolean neverLocked;
41:
42: /*
43: * True if the node was created this transaction.
44: */
45: boolean createdThisTxn;
46:
47: static final WriteLockInfo basicWriteLockInfo = new WriteLockInfo();
48:
49: public WriteLockInfo() {
50: abortLsn = DbLsn.NULL_LSN;
51: abortKnownDeleted = false;
52: neverLocked = true;
53: createdThisTxn = false;
54: }
55:
56: public boolean getAbortKnownDeleted() {
57: return abortKnownDeleted;
58: }
59:
60: public long getAbortLsn() {
61: return abortLsn;
62: }
63:
64: public void setAbortLogSize(int logSize) {
65: abortLogSize = logSize;
66: }
67: }
|