kstaken 2003/02/15 15:00:31
Modified: . README contributor.xml
java/scratchpad/solemnis/src/org/apache/xindice/core/file
PageFile.java
Log:
Adding some docs about the poor state of the docs so we can do a release.
Revision Changes Path
1.3 +25 -1 xml-xindice/README
Index: README
===================================================================
RCS file: /home/cvs/xml-xindice/README,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- README 27 Nov 2002 08:23:49 -0000 1.2
+++ README 15 Feb 2003 23:00:31 -0000 1.3
@@ -40,9 +40,33 @@
Release Notes
-------------
-Apache Xindice Version 1.1
+Apache Xindice Version 1.1b1
=============================
+IMPORTANT NOTE: Deployment of Xindice 1.1 is very different
+from Xindice 1.0. In many ways this should constitute a full
+version change since it isn't really backwards compatible
+with 1.0. However, the reasons this was done was to simplify
+the code base in preparation for future development.
+Unfortunately, the new features added do not justify a version
+change to 2.0.
+
+- Documentation for this release is badly out of date. Volunteers
+ are needed to update it before 1.1 final is released.
+
+- Server side installation is now done by deploying a WAR
+ archive within a Java servlet engine. See the document in
+ docs/community/howto/installation/tomcat.html for information
+ on using Tomcat. Note: this document needs to be updated along
+ with all the others.
+
+- The database is now deployed within a servlet engine to enable
+ network access. This is different from in 1.0 where Xindice had
+ its own server framework. This change was made because the
+ custom Xindice server framework just duplicated much of the
+ functionality provided by servlet engines. This has the nice
+ side effect of creating more flexibility in deployment options.
+
- The network access API is now based on XML-RPC rather then
CORBA. This was done for simplification and to eliminate the
constant problems with the CORBA ORB and consumption of
1.6 +2 -2 xml-xindice/contributor.xml
Index: contributor.xml
===================================================================
RCS file: /home/cvs/xml-xindice/contributor.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- contributor.xml 6 Feb 2003 04:46:35 -0000 1.5
+++ contributor.xml 15 Feb 2003 23:00:31 -0000 1.6
@@ -21,7 +21,7 @@
<!-- Project's properties -->
<property name="project.name" value="xml-xindice"/>
<property name="project.filename" value="xindice"/>
- <property name="project.version" value="1.1b"/>
+ <property name="project.version" value="1.1b1"/>
<property name="project.year" value="1999-2002"/>
<property name="webapp.name" value="Xindice"/>
1.2 +17 -154
xml-xindice/java/scratchpad/solemnis/src/org/apache/xindice/core/file/PageFile.java
Index: PageFile.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/scratchpad/solemnis/src/org/apache/xindice/core/file/PageFile.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PageFile.java 7 Feb 2003 17:09:06 -0000 1.1
+++ PageFile.java 15 Feb 2003 23:00:31 -0000 1.2
@@ -61,158 +61,21 @@
import java.io.*;
-public class PageFile {
- public static final int HEADER_PAGE = 0;
+/**
+ * Provides an abstract interface to a paged file structure. The intention
+ * of this interface is to enable the replacement of the page file layer with
+ * an alternative implementation. In particular to support java.io and
java.nio
+ * implementations of the PageFile layer.
+ */
+public interface PageFile {
- /* Version markers are used to determine compatibility of file changes.
- These numbers should be incremented anytime a change to the file format
- occurs. The minor version number is bumped when a backwards compatibile
- change is made and the major version is bumped when a non-backwards
- compatible change is made.
- */
- public static final int FILE_VERSION_MAJOR = 1;
- public static final int FILE_VERSION_MINOR = 0;
+ public void createFile(File testFile);
- public static final long INITIAL_EXTENT = 2048;
+ public Page readPage(long pageNumber);
- // Header fields, these should be listed in the order in which they appear
- // in the file.
- protected int versionMajor = FILE_VERSION_MAJOR;
- protected int versionMinor = FILE_VERSION_MINOR;
- protected int pageSize = 4096;
- // Number of pages, not including the header page
- protected long numberOfPages = 0;
- protected long nextFreePage = 1;
- // End header fields
+ public Page getFreePage();
- protected boolean headerDirty = false;
+ public void writePage(Page page);
- protected RandomAccessFile file;
-
- public PageFile(String filename, int pageSize) {
- try {
- this.pageSize = pageSize;
-
- File testFile = new File(filename);
- if ( ! testFile.exists() ) {
- createFile(testFile);
-
- // We're creating a new file so write a new header to it.
- writeHeader();
- }
- else {
- file = new RandomAccessFile(testFile, "rw");
- // Opening an existing file so read the header.
- readHeader();
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- protected void createFile(File testFile) {
- try {
- file = new RandomAccessFile(testFile, "rw");
- file.seek(INITIAL_EXTENT * pageSize);
- file.write(1);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- protected void readHeader() {
- try {
- Page page = readPage(HEADER_PAGE);
- ByteArrayInputStream bytes = new
ByteArrayInputStream(page.getData());
- DataInputStream stream = new DataInputStream(bytes);
-
- versionMajor = stream.readInt();
- versionMinor = stream.readInt();
- pageSize = stream.readInt();
- numberOfPages = stream.readLong();
- nextFreePage = stream.readLong();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- protected synchronized void writeHeader() {
- try {
- ByteArrayOutputStream bytes = new ByteArrayOutputStream(pageSize);
- DataOutputStream stream = new DataOutputStream(bytes);
-
- stream.writeInt(versionMajor);
- stream.writeInt(versionMinor);
- stream.writeInt(pageSize);
- stream.writeLong(numberOfPages);
- stream.writeLong(nextFreePage);
-
- Page page = new Page(bytes.toByteArray(), HEADER_PAGE);
- writePage(page);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public Page readPage(long pageNumber) {
- try {
- byte[] buffer = new byte[pageSize];
- synchronized(this) {
- file.seek(pageNumber * pageSize);
- file.read(buffer);
- }
-
- return new Page(buffer, pageNumber);
- }
- catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
-
- public synchronized Page getFreePage() {
- try {
- long pageNumber = nextFreePage;
- byte[] buffer = new byte[pageSize];
- file.seek(pageNumber * pageSize);
- file.read(buffer);
-
- // Read the pointer to the next free page, or look to end of file.
- nextFreePage++;
- headerDirty = true;
-
- return new Page(buffer, pageNumber);
- }
- catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
-
- public synchronized void writePage(Page page) {
- try {
- file.seek(page.getPageNumber() * pageSize);
- file.write(page.getData());
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void close() {
- try {
- if ( headerDirty ) {
- writeHeader();
- }
-
- file.close();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
+ public void close();
}