KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > recovery > stepwise > NonTxnalEntry


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

8
9 package com.sleepycat.je.recovery.stepwise;
10
11 import java.util.Map JavaDoc;
12 import java.util.Set JavaDoc;
13
14 import com.sleepycat.bind.tuple.IntegerBinding;
15 import com.sleepycat.je.DatabaseEntry;
16
17 /*
18  * A non-transactional log entry should add itself to the expected set.
19  */

20
21 public class NonTxnalEntry extends LogEntryInfo {
22     NonTxnalEntry(long lsn,
23                   int key,
24                   int data) {
25         super(lsn, key, data);
26     }
27
28     /* Implement this accordingly. For example, a LogEntryInfo which
29      * represents a non-txnal LN record would add that key/data to the
30      * expected set. A txnal delete LN record would delete the record
31      * from the expecte set at commit time.
32      */

33     public void updateExpectedSet(Set JavaDoc useExpected, Map JavaDoc newUncommittedRecords, Map JavaDoc deletedUncommittedRecords) {
34         DatabaseEntry keyEntry = new DatabaseEntry();
35         DatabaseEntry dataEntry = new DatabaseEntry();
36
37         IntegerBinding.intToEntry(key, keyEntry);
38         IntegerBinding.intToEntry(data, dataEntry);
39         
40         useExpected.add(new TestData(keyEntry, dataEntry));
41     }
42 }
43
Popular Tags