Update of /cvsroot/exist/eXist-1.0/src/org/exist/util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18976/src/org/exist/util
Modified Files:
XMLString.java FixedByteArray.java
Log Message:
Fixed class LRUCache. LRUCache is now used for the data pages in DOMFile + BFile. LRU seems to be a better strategy for the data pages than
LRD. It produces less page failures.
Index: FixedByteArray.java
===================================================================
RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/util/FixedByteArray.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FixedByteArray.java 10 May 2004 11:22:40 -0000 1.2
--- FixedByteArray.java 15 Aug 2004 20:29:09 -0000 1.3
***************
*** 9,15 ****
private byte[] data;
! public FixedByteArray(byte[] data) {
this.data = data;
}
--- 9,19 ----
private byte[] data;
+ private int start;
+ private int len;
! public FixedByteArray(byte[] data, int start, int len) {
this.data = data;
+ this.start = start;
+ this.len = len;
}
***************
*** 25,29 ****
*/
public void copyTo(byte[] b, int offset, int length) {
! System.arraycopy(data, 0, b, offset, length);
}
--- 29,33 ----
*/
public void copyTo(byte[] b, int offset, int length) {
! System.arraycopy(data, start, b, offset, length);
}
***************
*** 32,36 ****
*/
public void copyTo(byte[] b, int offset) {
! System.arraycopy(data, 0, b, offset, data.length);
}
--- 36,40 ----
*/
public void copyTo(byte[] b, int offset) {
! System.arraycopy(data, start, b, offset, len);
}
***************
*** 38,47 ****
* @see org.exist.util.ByteArray#copyTo(int, byte[], int, int)
*/
! public void copyTo(int start, byte[] newBuf, int offset, int len) {
! System.arraycopy(data, start, newBuf, offset, len);
}
public void copyTo(ByteArray other) {
! other.append(data, 0, data.length);
}
--- 42,51 ----
* @see org.exist.util.ByteArray#copyTo(int, byte[], int, int)
*/
! public void copyTo(int startOffset, byte[] newBuf, int offset, int count) {
! System.arraycopy(data, start + startOffset, newBuf, offset, count);
}
public void copyTo(ByteArray other) {
! other.append(data, start, len);
}
***************
*** 71,75 ****
*/
public int size() {
! return data.length;
}
--- 75,79 ----
*/
public int size() {
! return len;
}
Index: XMLString.java
===================================================================
RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/util/XMLString.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** XMLString.java 27 Apr 2004 15:46:57 -0000 1.9
--- XMLString.java 15 Aug 2004 20:29:09 -0000 1.10
***************
*** 198,202 ****
*/
public final CharSequence subSequence(int start, int end) {
! return new String(value_, start_ + start, end - start);
}
--- 198,202 ----
*/
public final CharSequence subSequence(int start, int end) {
! return new XMLString(value_, start_ + start, end - start);
}
|