001: package com.quadcap.sql.file;
002:
003: /* Copyright 1999 - 2003 Quadcap Software. All rights reserved.
004: *
005: * This software is distributed under the Quadcap Free Software License.
006: * This software may be used or modified for any purpose, personal or
007: * commercial. Open Source redistributions are permitted. Commercial
008: * redistribution of larger works derived from, or works which bundle
009: * this software requires a "Commercial Redistribution License"; see
010: * http://www.quadcap.com/purchase.
011: *
012: * Redistributions qualify as "Open Source" under one of the following terms:
013: *
014: * Redistributions are made at no charge beyond the reasonable cost of
015: * materials and delivery.
016: *
017: * Redistributions are accompanied by a copy of the Source Code or by an
018: * irrevocable offer to provide a copy of the Source Code for up to three
019: * years at the cost of materials and delivery. Such redistributions
020: * must allow further use, modification, and redistribution of the Source
021: * Code under substantially the same terms as this license.
022: *
023: * Redistributions of source code must retain the copyright notices as they
024: * appear in each source code file, these license terms, and the
025: * disclaimer/limitation of liability set forth as paragraph 6 below.
026: *
027: * Redistributions in binary form must reproduce this Copyright Notice,
028: * these license terms, and the disclaimer/limitation of liability set
029: * forth as paragraph 6 below, in the documentation and/or other materials
030: * provided with the distribution.
031: *
032: * The Software is provided on an "AS IS" basis. No warranty is
033: * provided that the Software is free of defects, or fit for a
034: * particular purpose.
035: *
036: * Limitation of Liability. Quadcap Software shall not be liable
037: * for any damages suffered by the Licensee or any third party resulting
038: * from use of the Software.
039: */
040:
041: import java.io.File;
042: import java.io.IOException;
043:
044: import java.util.Properties;
045:
046: import com.quadcap.sql.lock.Transaction;
047:
048: /**
049: * Interface to logging subsystem.
050: *
051: * @author Stan Bailes
052: */
053: public class Log0 implements Log {
054: Datafile db;
055:
056: /**
057: * Initialize the logging subsystem
058: */
059: public void init(Datafile db, boolean create, Properties props)
060: throws IOException {
061: this .db = db;
062: }
063:
064: /**
065: * Start the logging subsystem
066: */
067: public void start() {
068: }
069:
070: /**
071: * Return the database that we're logging for
072: */
073: public Datafile getDatafile() {
074: return db;
075: }
076:
077: /**
078: * Return the database root directory
079: */
080: public File getDbRootDir() {
081: return db.getDbRootDir();
082: }
083:
084: /**
085: * Add a transaction's log record to the end of the open log file
086: */
087: public void addEntry(LogEntry entry) throws IOException {
088: }
089:
090: /**
091: * XXX why public?
092: */
093: public void reallyAddEntry(LogEntry entry) throws IOException {
094: }
095:
096: /**
097: * Flush and close the log file.
098: */
099: public void close() throws IOException {
100: }
101:
102: /**
103: * Flush all log records to disk.
104: */
105: public void flushLog() throws IOException {
106: }
107:
108: /**
109: * Perform a checkpoint operation.
110: */
111: public void checkpoint() throws IOException {
112: }
113:
114: /**
115: * Wait for all queue ops to be processed by the log sync thread
116: */
117: public void sync() throws IOException {
118: }
119:
120: /**
121: * Transaction rollback.
122: */
123: public void rollbackTransaction(Transaction trans)
124: throws IOException {
125: }
126:
127: /**
128: * Statement rollback.
129: */
130: public void rollbackStatement(Transaction trans, int stmtId)
131: throws IOException {
132: }
133:
134: /**
135: * Restart from a previous state
136: */
137: public void restart() throws Exception {
138: }
139:
140: /**
141: * Retrieve a row mapping.
142: */
143: public long getRowMap(long rowId) {
144: return rowId;
145: }
146:
147: /**
148: * Remember a row mapping {old,new} The old row (logRow) is now stored
149: * in a new place (fileRow), so any stored log entries that refer to
150: * the old row need to be translated to use the new row.
151: *
152: * @param logRow the "old" row
153: * @param fileRow the "new" row
154: */
155: public void putRowMap(long logRow, long fileRow) {
156: }
157:
158: /**
159: * Discard a row mapping
160: */
161: public void removeRowMap(long row) {
162: }
163:
164: /**
165: * Are you logging?
166: *
167: * No, I am not.
168: */
169: public boolean isLogging() {
170: return false;
171: }
172:
173: /**
174: * Save a "before" image
175: */
176: public void saveBlock(long b) throws IOException {
177: }
178:
179: /**
180: * Restore all the "before" images
181: */
182: public void restoreBlocks() throws IOException {
183: }
184:
185: /**
186: * Reset the "before" list to be empty
187: */
188: public void resetBlocks() throws IOException {
189: }
190:
191: /**
192: * Remove the log file
193: */
194: public void remove() {
195: }
196:
197: /**
198: * We don't recover because we never miss.
199: */
200: public boolean inRecovery() {
201: return false;
202: }
203:
204: }
|