/[gentoo-x86]/dev-java/cdegroot-db/files/cdegroot-db-0.08-gentoo.patch
Gentoo

Contents of /dev-java/cdegroot-db/files/cdegroot-db-0.08-gentoo.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sun Feb 6 00:37:14 2005 UTC (15 years ago) by luckyduck
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-diff
Initial import.
(Portage version: 2.0.51-r15)

1 diff -urpN src.orig/db/com/cdegroot/db/hash/EntryPage.java src/db/com/cdegroot/db/hash/EntryPage.java
2 --- src.orig/db/com/cdegroot/db/hash/EntryPage.java 2005-02-06 00:40:17.191151504 +0100
3 +++ src/db/com/cdegroot/db/hash/EntryPage.java 2005-02-06 00:54:14.045930240 +0100
4 @@ -25,7 +25,7 @@ final class EntryPage extends PageHeader
5 /**
6 * Constructs a page view from the indicated block.
7 */
8 - EntryPage(BlockIo block) {
9 + public EntryPage(BlockIo block) {
10 super(block);
11 }
12
13 @@ -33,7 +33,7 @@ final class EntryPage extends PageHeader
14 * Factory method to create or return a data page for the
15 * indicated block.
16 */
17 - static EntryPage getEntryPageView(BlockIo block) {
18 + public static EntryPage getEntryPageView(BlockIo block) {
19 BlockView view = block.getView();
20 if (view != null && view instanceof EntryPage)
21 return (EntryPage) view;
22 diff -urpN src.orig/db/com/cdegroot/db/recman/BlockIo.java src/db/com/cdegroot/db/recman/BlockIo.java
23 --- src.orig/db/com/cdegroot/db/recman/BlockIo.java 2005-02-06 00:40:17.192151352 +0100
24 +++ src/db/com/cdegroot/db/recman/BlockIo.java 2005-02-06 00:58:02.990125432 +0100
25 @@ -31,7 +31,7 @@ package com.cdegroot.db.recman;
26 * @see java.io.DataInput
27 * @see java.io.DataOutput
28 */
29 -final class BlockIo implements java.io.Serializable {
30 +final public class BlockIo implements java.io.Serializable {
31 private long blockId;
32 private final byte[] snapshot; // committed snapshot.
33 private boolean snapshotValid = false;
34 @@ -44,7 +44,7 @@ final class BlockIo implements java.io.S
35 * Constructs a new BlockIo instance working on the indicated
36 * buffer.
37 */
38 - BlockIo(long blockId, byte[] data) {
39 + public BlockIo(long blockId, byte[] data) {
40 // removeme for production version
41 if (blockId > 10000000000L)
42 throw new Error("bogus block id " + blockId);
43 @@ -108,7 +108,7 @@ final class BlockIo implements java.io.S
44 /**
45 * Returns the current view of the block.
46 */
47 - BlockView getView() {
48 + public BlockView getView() {
49 return view;
50 }
51
52 @@ -172,17 +172,25 @@ final class BlockIo implements java.io.S
53 /**
54 * Reads a short from the indicated position
55 */
56 - short readShort(int pos) {
57 + public short readShort(int pos) {
58 return (short)
59 (((short) (data[pos+0] & 0xff) << 8) |
60 ((short) (data[pos+1] & 0xff) << 0));
61
62 }
63 +
64 + public byte readByte(int pos) {
65 + return data[pos];
66 + }
67 +
68 + public void writeByte(int pos, byte value)
69 + { data[pos] = value;
70 + }
71
72 /**
73 * Writes a short to the indicated position
74 */
75 - void writeShort(int pos, short value) {
76 + public void writeShort(int pos, short value) {
77 data[pos+0] = (byte)(0xff & (value >> 8));
78 data[pos+1] = (byte)(0xff & (value >> 0));
79 setDirty();
80 @@ -191,7 +199,7 @@ final class BlockIo implements java.io.S
81 /**
82 * Reads an int from the indicated position
83 */
84 - int readInt(int pos) {
85 + public int readInt(int pos) {
86 return
87 (((int)(data[pos+0] & 0xff) << 24) |
88 ((int)(data[pos+1] & 0xff) << 16) |
89 @@ -202,7 +210,7 @@ final class BlockIo implements java.io.S
90 /**
91 * Writes an int to the indicated position
92 */
93 - void writeInt(int pos, int value) {
94 + public void writeInt(int pos, int value) {
95 data[pos+0] = (byte)(0xff & (value >> 24));
96 data[pos+1] = (byte)(0xff & (value >> 16));
97 data[pos+2] = (byte)(0xff & (value >> 8));
98 @@ -213,7 +221,7 @@ final class BlockIo implements java.io.S
99 /**
100 * Reads a long from the indicated position
101 */
102 - long readLong(int pos) {
103 + public long readLong(int pos) {
104 return
105 (((long)(data[pos+0] & 0xff) << 56) |
106 ((long)(data[pos+1] & 0xff) << 48) |
107 @@ -228,7 +236,7 @@ final class BlockIo implements java.io.S
108 /**
109 * Writes a long to the indicated position
110 */
111 - void writeLong(int pos, long value) {
112 + public void writeLong(int pos, long value) {
113 data[pos+0] = (byte)(0xff & (value >> 56));
114 data[pos+1] = (byte)(0xff & (value >> 48));
115 data[pos+2] = (byte)(0xff & (value >> 40));
116 diff -urpN src.orig/db/com/cdegroot/db/recman/BlockView.java src/db/com/cdegroot/db/recman/BlockView.java
117 --- src.orig/db/com/cdegroot/db/recman/BlockView.java 2005-02-06 00:40:17.193151200 +0100
118 +++ src/db/com/cdegroot/db/recman/BlockView.java 2005-02-06 00:47:57.632153832 +0100
119 @@ -28,5 +28,5 @@ package com.cdegroot.db.recman;
120 *
121 * @see BlockIo.setView()
122 */
123 -interface BlockView {
124 +public interface BlockView {
125 }
126 diff -urpN src.orig/db/com/cdegroot/db/recman/Magic.java src/db/com/cdegroot/db/recman/Magic.java
127 --- src.orig/db/com/cdegroot/db/recman/Magic.java 2005-02-06 00:40:17.193151200 +0100
128 +++ src/db/com/cdegroot/db/recman/Magic.java 2005-02-06 00:44:22.164909832 +0100
129 @@ -25,7 +25,7 @@ package com.cdegroot.db.recman;
130 /**
131 * This interface contains magic cookies.
132 */
133 -interface Magic {
134 +public interface Magic {
135 /** Magic cookie at start of file */
136 short FILE_HEADER = 0x1350;
137
138 @@ -57,4 +57,6 @@ interface Magic {
139 int SZ_INT = 4;
140 /** Size of an externalized long */
141 int SZ_LONG = 8;
142 + /** Size of byte */
143 + int SZ_BYTE = 1;
144 }
145 diff -urpN src.orig/db/com/cdegroot/db/recman/PageHeader.java src/db/com/cdegroot/db/recman/PageHeader.java
146 --- src.orig/db/com/cdegroot/db/recman/PageHeader.java 2005-02-06 00:40:17.193151200 +0100
147 +++ src/db/com/cdegroot/db/recman/PageHeader.java 2005-02-06 00:50:10.236994832 +0100
148 @@ -28,15 +28,15 @@ import java.io.*;
149 * This class represents a page header. It is the common superclass for
150 * all different page views.
151 */
152 -class PageHeader implements BlockView {
153 +public class PageHeader implements BlockView {
154 // offsets
155 private static final short O_MAGIC = 0; // short magic
156 private static final short O_NEXT = Magic.SZ_SHORT; // long next
157 private static final short O_PREV = O_NEXT + Magic.SZ_LONG; // long prev
158 - static final int SIZE = O_PREV + Magic.SZ_LONG;
159 + public static final int SIZE = O_PREV + Magic.SZ_LONG;
160
161 // my block
162 - BlockIo block;
163 + public BlockIo block;
164
165 /**
166 * Constructs a PageHeader object from a block
167 @@ -45,7 +45,7 @@ class PageHeader implements BlockView {
168 * @throws IOException if the block is too short to keep the file
169 * header.
170 */
171 - PageHeader(BlockIo block) {
172 + public PageHeader(BlockIo block) {
173 initialize(block);
174 if (!magicOk())
175 throw new Error("CRITICAL: page header magic for block "
176 @@ -66,7 +66,7 @@ class PageHeader implements BlockView {
177 * Factory method to create or return a page header for the
178 * indicated block.
179 */
180 - static PageHeader getView(BlockIo block) {
181 + public static PageHeader getView(BlockIo block) {
182 BlockView view = block.getView();
183 if (view != null && view instanceof PageHeader)
184 return (PageHeader) view;
185 diff -urpN src.orig/db/com/cdegroot/db/recman/RecordFile.java src/db/com/cdegroot/db/recman/RecordFile.java
186 --- src.orig/db/com/cdegroot/db/recman/RecordFile.java 2005-02-06 00:40:17.193151200 +0100
187 +++ src/db/com/cdegroot/db/recman/RecordFile.java 2005-02-06 00:45:38.616287456 +0100
188 @@ -33,7 +33,7 @@ import java.util.*;
189 * The set of dirty records on the in-use list constitutes a transaction.
190 * Later on, we will send these records to some recovery thingy.
191 */
192 -final class RecordFile {
193 +final public class RecordFile {
194 private final TransactionManager txnMgr;
195
196 // Todo: reorganize in hashes and fifos as necessary.
197 @@ -48,7 +48,7 @@ final class RecordFile {
198 private boolean transactionsDisabled = false;
199
200 /** The length of a single block. */
201 - final static int BLOCK_SIZE = 8192;//4096;
202 + final public static int BLOCK_SIZE = 8192;//4096;
203
204 /** The extension of a record file */
205 final static String extension = ".db";

  ViewVC Help
Powered by ViewVC 1.1.20