KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quadcap > sql > file > Log0


1 package com.quadcap.sql.file;
2
3 /* Copyright 1999 - 2003 Quadcap Software. All rights reserved.
4  *
5  * This software is distributed under the Quadcap Free Software License.
6  * This software may be used or modified for any purpose, personal or
7  * commercial. Open Source redistributions are permitted. Commercial
8  * redistribution of larger works derived from, or works which bundle
9  * this software requires a "Commercial Redistribution License"; see
10  * http://www.quadcap.com/purchase.
11  *
12  * Redistributions qualify as "Open Source" under one of the following terms:
13  *
14  * Redistributions are made at no charge beyond the reasonable cost of
15  * materials and delivery.
16  *
17  * Redistributions are accompanied by a copy of the Source Code or by an
18  * irrevocable offer to provide a copy of the Source Code for up to three
19  * years at the cost of materials and delivery. Such redistributions
20  * must allow further use, modification, and redistribution of the Source
21  * Code under substantially the same terms as this license.
22  *
23  * Redistributions of source code must retain the copyright notices as they
24  * appear in each source code file, these license terms, and the
25  * disclaimer/limitation of liability set forth as paragraph 6 below.
26  *
27  * Redistributions in binary form must reproduce this Copyright Notice,
28  * these license terms, and the disclaimer/limitation of liability set
29  * forth as paragraph 6 below, in the documentation and/or other materials
30  * provided with the distribution.
31  *
32  * The Software is provided on an "AS IS" basis. No warranty is
33  * provided that the Software is free of defects, or fit for a
34  * particular purpose.
35  *
36  * Limitation of Liability. Quadcap Software shall not be liable
37  * for any damages suffered by the Licensee or any third party resulting
38  * from use of the Software.
39  */

40
41 import java.io.File JavaDoc;
42 import java.io.IOException JavaDoc;
43
44 import java.util.Properties JavaDoc;
45
46 import com.quadcap.sql.lock.Transaction;
47
48 /**
49  * Interface to logging subsystem.
50  *
51  * @author Stan Bailes
52  */

53 public class Log0 implements Log {
54     Datafile db;
55     /**
56      * Initialize the logging subsystem
57      */

58     public void init(Datafile db, boolean create, Properties JavaDoc props)
59     throws IOException JavaDoc
60     {
61         this.db = db;
62     }
63
64     /**
65      * Start the logging subsystem
66      */

67     public void start() {}
68
69     /**
70      * Return the database that we're logging for
71      */

72     public Datafile getDatafile() { return db; }
73
74     /**
75      * Return the database root directory
76      */

77     public File JavaDoc getDbRootDir() { return db.getDbRootDir(); }
78
79     /**
80      * Add a transaction's log record to the end of the open log file
81      */

82     public void addEntry(LogEntry entry) throws IOException JavaDoc {}
83
84     /**
85      * XXX why public?
86      */

87     public void reallyAddEntry(LogEntry entry) throws IOException JavaDoc {}
88     
89     /**
90      * Flush and close the log file.
91      */

92     public void close() throws IOException JavaDoc {}
93     
94     /**
95      * Flush all log records to disk.
96      */

97     public void flushLog() throws IOException JavaDoc {}
98
99     /**
100      * Perform a checkpoint operation.
101      */

102     public void checkpoint() throws IOException JavaDoc {}
103
104     /**
105      * Wait for all queue ops to be processed by the log sync thread
106      */

107     public void sync() throws IOException JavaDoc {}
108
109     /**
110      * Transaction rollback.
111      */

112     public void rollbackTransaction(Transaction trans) throws IOException JavaDoc {}
113         
114     /**
115      * Statement rollback.
116      */

117     public void rollbackStatement(Transaction trans, int stmtId)
118     throws IOException JavaDoc
119     {
120     }
121
122     /**
123      * Restart from a previous state
124      */

125     public void restart() throws Exception JavaDoc {}
126
127     /**
128      * Retrieve a row mapping.
129      */

130     public long getRowMap(long rowId) { return rowId; }
131
132     /**
133      * Remember a row mapping {old,new} The old row (logRow) is now stored
134      * in a new place (fileRow), so any stored log entries that refer to
135      * the old row need to be translated to use the new row.
136      *
137      * @param logRow the "old" row
138      * @param fileRow the "new" row
139      */

140     public void putRowMap(long logRow, long fileRow) {}
141
142     /**
143      * Discard a row mapping
144      */

145     public void removeRowMap(long row) {}
146
147     /**
148      * Are you logging?
149      *
150      * No, I am not.
151      */

152     public boolean isLogging() { return false; }
153
154     /**
155      * Save a "before" image
156      */

157     public void saveBlock(long b) throws IOException JavaDoc {
158     }
159
160     /**
161      * Restore all the "before" images
162      */

163     public void restoreBlocks() throws IOException JavaDoc {
164     }
165
166     /**
167      * Reset the "before" list to be empty
168      */

169     public void resetBlocks() throws IOException JavaDoc {
170     }
171
172     /**
173      * Remove the log file
174      */

175     public void remove() {
176     }
177
178     /**
179      * We don't recover because we never miss.
180      */

181     public boolean inRecovery() { return false; }
182     
183 }
184
185
Popular Tags