You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(57) |
Apr
(103) |
May
(164) |
Jun
(139) |
Jul
(173) |
Aug
(196) |
Sep
(221) |
Oct
(333) |
Nov
(214) |
Dec
(88) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(163) |
Feb
(165) |
Mar
(98) |
Apr
(93) |
May
(199) |
Jun
(118) |
Jul
(200) |
Aug
(212) |
Sep
(185) |
Oct
(297) |
Nov
(437) |
Dec
(272) |
2006 |
Jan
(542) |
Feb
(329) |
Mar
(267) |
Apr
(332) |
May
(267) |
Jun
(130) |
Jul
(161) |
Aug
(348) |
Sep
(166) |
Oct
(305) |
Nov
(173) |
Dec
(173) |
2007 |
Jan
(199) |
Feb
(118) |
Mar
(133) |
Apr
(200) |
May
(208) |
Jun
(146) |
Jul
(198) |
Aug
(146) |
Sep
(187) |
Oct
(182) |
Nov
(181) |
Dec
(83) |
2008 |
Jan
(252) |
Feb
(124) |
Mar
(124) |
Apr
(101) |
May
(143) |
Jun
(122) |
Jul
(129) |
Aug
(60) |
Sep
(80) |
Oct
(89) |
Nov
(54) |
Dec
(112) |
2009 |
Jan
(88) |
Feb
(145) |
Mar
(105) |
Apr
(164) |
May
(123) |
Jun
(154) |
Jul
(374) |
Aug
(341) |
Sep
(219) |
Oct
(137) |
Nov
(373) |
Dec
(240) |
2010 |
Jan
(197) |
Feb
(270) |
Mar
(253) |
Apr
(150) |
May
(102) |
Jun
(51) |
Jul
(300) |
Aug
(512) |
Sep
(254) |
Oct
(258) |
Nov
(288) |
Dec
(143) |
2011 |
Jan
(238) |
Feb
(179) |
Mar
(253) |
Apr
(332) |
May
(248) |
Jun
(255) |
Jul
(216) |
Aug
(282) |
Sep
(146) |
Oct
(77) |
Nov
(86) |
Dec
(69) |
2012 |
Jan
(172) |
Feb
(234) |
Mar
(229) |
Apr
(101) |
May
(212) |
Jun
(267) |
Jul
(129) |
Aug
(210) |
Sep
(239) |
Oct
(271) |
Nov
(368) |
Dec
(220) |
2013 |
Jan
(179) |
Feb
(155) |
Mar
(59) |
Apr
(47) |
May
(99) |
Jun
(158) |
Jul
(185) |
Aug
(16) |
Sep
(16) |
Oct
(7) |
Nov
(20) |
Dec
(12) |
2014 |
Jan
(21) |
Feb
(17) |
Mar
(18) |
Apr
(13) |
May
(27) |
Jun
(15) |
Jul
(19) |
Aug
(22) |
Sep
(30) |
Oct
(16) |
Nov
(19) |
Dec
(16) |
2015 |
Jan
(14) |
Feb
(24) |
Mar
(33) |
Apr
(41) |
May
(14) |
Jun
(80) |
Jul
(53) |
Aug
(8) |
Sep
(7) |
Oct
(15) |
Nov
(13) |
Dec
(2) |
2016 |
Jan
(22) |
Feb
(12) |
Mar
(30) |
Apr
(6) |
May
(33) |
Jun
(16) |
Jul
(8) |
Aug
(20) |
Sep
(12) |
Oct
(18) |
Nov
(12) |
Dec
(11) |
2017 |
Jan
(24) |
Feb
(26) |
Mar
(47) |
Apr
(23) |
May
(19) |
Jun
(14) |
Jul
(28) |
Aug
(30) |
Sep
(17) |
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
(73) |
Mar
(90) |
Apr
(42) |
May
(116) |
Jun
(90) |
Jul
(127) |
Aug
(103) |
Sep
(56) |
Oct
(42) |
Nov
(95) |
Dec
(58) |
2020 |
Jan
(102) |
Feb
(31) |
Mar
(93) |
Apr
(60) |
May
(57) |
Jun
(45) |
Jul
(29) |
Aug
(32) |
Sep
(44) |
Oct
(86) |
Nov
(51) |
Dec
(71) |
2021 |
Jan
(44) |
Feb
(25) |
Mar
(78) |
Apr
(130) |
May
(64) |
Jun
(74) |
Jul
(21) |
Aug
(64) |
Sep
(40) |
Oct
(43) |
Nov
(21) |
Dec
(99) |
2022 |
Jan
(154) |
Feb
(64) |
Mar
(45) |
Apr
(95) |
May
(62) |
Jun
(48) |
Jul
(73) |
Aug
(37) |
Sep
(71) |
Oct
(27) |
Nov
(40) |
Dec
(65) |
2023 |
Jan
(89) |
Feb
(130) |
Mar
(124) |
Apr
(50) |
May
(93) |
Jun
(46) |
Jul
(45) |
Aug
(68) |
Sep
(62) |
Oct
(71) |
Nov
(108) |
Dec
(82) |
2024 |
Jan
(53) |
Feb
(76) |
Mar
(64) |
Apr
(75) |
May
(36) |
Jun
(54) |
Jul
(98) |
Aug
(137) |
Sep
(58) |
Oct
(177) |
Nov
(84) |
Dec
(52) |
2025 |
Jan
(70) |
Feb
(53) |
Mar
(72) |
Apr
(47) |
May
(88) |
Jun
(49) |
Jul
(81) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:18:03
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/store In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/storage/store Modified Files: DOMFileIterator.java BFile.java NodeIterator.java DOMFile.java StorageAddress.java Added Files: ItemId.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: DOMFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/DOMFile.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** DOMFile.java 29 Mar 2004 14:15:12 -0000 1.20 --- DOMFile.java 14 Apr 2004 12:17:22 -0000 1.21 *************** *** 2,25 **** /* ! * eXist Open Source Native XML Database ! * Copyright (C) 2001, Wolfgang M. Meier (wol...@ex...) ! * ! * This library is free software; you can redistribute it and/or ! * modify it under the terms of the GNU Library General Public License ! * as published by the Free Software Foundation; either version 2 ! * of the License, or (at your option) any later version. ! * [...3302 lines suppressed...] ! return true; ! } ! } ! ! protected final static class RecordPos { ! ! int offset = -1; ! ! DOMPage page = null; ! ! short tid = 0; ! ! public RecordPos(int offset, DOMPage page, short tid) { ! this.offset = offset; ! this.page = page; ! this.tid = tid; ! } ! } ! } \ No newline at end of file Index: BFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/BFile.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** BFile.java 29 Mar 2004 14:15:12 -0000 1.16 --- BFile.java 14 Apr 2004 12:17:22 -0000 1.17 *************** *** 70,74 **** public class BFile extends BTree { ! public final static short FILE_FORMAT_VERSION_ID = 2; // minimum free space a page should have to be --- 70,74 ---- public class BFile extends BTree { ! public final static short FILE_FORMAT_VERSION_ID = 3; // minimum free space a page should have to be *************** *** 88,93 **** public int fixedKeyLen = -1; - private int overflow = 0; - public BFile() { super(); --- 88,91 ---- *************** *** 466,474 **** if (wp == null) { final Page page = getPage(pos); - final byte[] data = page.read(); if (page == null) { LOG.debug("page " + pos + " not found!"); return null; } if (page.getPageHeader().getStatus() == MULTI_PAGE) return new OverflowPage(page, data); --- 464,472 ---- if (wp == null) { final Page page = getPage(pos); if (page == null) { LOG.debug("page " + pos + " not found!"); return null; } + final byte[] data = page.read(); if (page.getPageHeader().getStatus() == MULTI_PAGE) return new OverflowPage(page, data); *************** *** 848,852 **** private OrderedLinkedList freeList = new OrderedLinkedList(); ! private long freeSpacePage = -1; private long lastDataPage = -1; --- 846,850 ---- private OrderedLinkedList freeList = new OrderedLinkedList(); ! private long lastDataPage = -1; *************** *** 1498,1502 **** } ! private final class SimplePageInputStream extends ByteArrayInputStream implements PageInputStream { --- 1496,1500 ---- } ! private final static class SimplePageInputStream extends ByteArrayInputStream implements PageInputStream { *************** *** 1519,1526 **** * @author wolf */ ! private class MultiPageInputStream extends InputStream implements PageInputStream { private SinglePage nextPage_; - private int len_ = -1; private int pageLen_; private int offset_ = 0; --- 1517,1523 ---- * @author wolf */ ! private final class MultiPageInputStream extends InputStream implements PageInputStream { private SinglePage nextPage_; private int pageLen_; private int offset_ = 0; *************** *** 1529,1533 **** public MultiPageInputStream(SinglePage first, long address) { nextPage_ = first; - len_ = first.ph.getDataLength() - 6; offset_ = 6; pageLen_ = fileHeader.getWorkSize(); --- 1526,1529 ---- *************** *** 1607,1611 **** public void close() throws IOException { nextPage_ = null; - len_ = -1; } --- 1603,1606 ---- Index: NodeIterator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/NodeIterator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NodeIterator.java 25 Feb 2004 15:31:57 -0000 1.4 --- NodeIterator.java 14 Apr 2004 12:17:22 -0000 1.5 *************** *** 26,38 **** private final static Logger LOG = Logger.getLogger(NodeIterator.class); ! DOMFile db = null; ! NodeProxy node = null; ! DocumentImpl doc = null; ! int offset; ! short lastTID = -1; ! DOMFile.DOMPage p = null; ! long page; ! long startAddress = -1; ! Object lockKey; public NodeIterator(Object lock, DOMFile db, NodeProxy node) --- 26,38 ---- private final static Logger LOG = Logger.getLogger(NodeIterator.class); ! private DOMFile db = null; ! private NodeProxy node = null; ! private DocumentImpl doc = null; ! private int offset; ! private short lastTID = -1; ! private DOMFile.DOMPage p = null; ! private long page; ! private long startAddress = -1; ! private Object lockKey; public NodeIterator(Object lock, DOMFile db, NodeProxy node) *************** *** 61,65 **** */ public long currentAddress() { ! return StorageAddress.createPointer((int) page, lastTID); } --- 61,65 ---- */ public long currentAddress() { ! return StorageAddress.createPointer((int) page, ItemId.getId(lastTID)); } *************** *** 98,104 **** /** ! * Returns the raw data of the next node in the sequence. ! * ! *@return Description of the Return Value */ public Object next() { --- 98,102 ---- /** ! * Returns the next node in document order. */ public Object next() { *************** *** 112,151 **** } if(gotoNextPosition()) { ! final DOMFile.DOMFilePageHeader ph = p.getPageHeader(); ! // next value larger than length of the current page? ! if (offset >= ph.getDataLength()) { ! // load next page in chain ! final long nextPage = ph.getNextDataPage(); ! if (nextPage < 0) { ! LOG.debug("bad link to next " + p.page.getPageInfo()); ! return null; } ! page = nextPage; ! p = db.getCurrentPage(nextPage); ! db.addToBuffer(p); ! offset = 0; ! } ! // extract the value ! lastTID = ByteConversion.byteToShort(p.data, offset); ! short l = ByteConversion.byteToShort(p.data, offset + 2); ! if(l == DOMFile.OVERFLOW) { ! // overflow page: load the overflow value ! l = 8; ! final long overflow = ByteConversion.byteToLong(p.data, offset + 4); ! final byte[] odata = db.getOverflowValue(overflow); ! nextNode = NodeImpl.deserialize(odata, 0, odata.length, doc); ! } else { ! nextNode = NodeImpl.deserialize(p.data, offset + 4, l, doc); ! } ! nextNode.setInternalAddress(StorageAddress.createPointer((int) page, lastTID)); ! nextNode.setOwnerDocument(doc); ! offset = offset + 4 + l; } return nextNode; } catch (BTreeException e) { ! Thread.dumpStack(); ! LOG.warn(e); } catch (IOException e) { ! LOG.warn(e); } finally { lock.release(); --- 110,169 ---- } if(gotoNextPosition()) { ! do { ! DOMFile.DOMFilePageHeader ph = p.getPageHeader(); ! // next value larger than length of the current page? ! if (offset >= ph.getDataLength()) { ! // load next page in chain ! long nextPage = ph.getNextDataPage(); ! if (nextPage < 0) { ! LOG.debug("bad link to next " + p.page.getPageInfo()); ! return null; ! } ! page = nextPage; ! p = db.getCurrentPage(nextPage); ! db.addToBuffer(p); ! offset = 0; } ! // extract the tid ! lastTID = ByteConversion.byteToShort(p.data, offset); ! if(ItemId.getId(lastTID) < 0) ! LOG.debug("tid < 0: " + lastTID + " at "+ p.page.getPageInfo()); ! offset += 2; ! // check if this is just a link to a relocated node ! if(ItemId.isLink(lastTID)) { ! // skip this ! offset += 8; ! continue; ! } ! // read data length ! short l = ByteConversion.byteToShort(p.data, offset); ! offset += 2; ! if(ItemId.isRelocated(lastTID)) { ! // found a relocated node. Skip the next 8 bytes ! offset += 8; ! } ! // overflow page? load the overflow value ! if(l == DOMFile.OVERFLOW) { ! l = 8; ! final long overflow = ByteConversion.byteToLong(p.data, offset); ! offset += 8; ! final byte[] odata = db.getOverflowValue(overflow); ! nextNode = NodeImpl.deserialize(odata, 0, odata.length, doc); ! // normal node ! } else { ! nextNode = NodeImpl.deserialize(p.data, offset, l, doc); ! offset += l; ! } ! nextNode.setInternalAddress( ! StorageAddress.createPointer((int) page, ItemId.getId(lastTID)) ! ); ! nextNode.setOwnerDocument(doc); ! } while(nextNode == null); } return nextNode; } catch (BTreeException e) { ! LOG.warn(e.getMessage(), e); } catch (IOException e) { ! LOG.warn(e.getMessage(), e); } finally { lock.release(); *************** *** 161,165 **** if (addr == BTree.KEY_NOT_FOUND) return false; ! DOMFile.RecordPos rec = db.findValuePosition(addr); page = rec.page.getPageNum(); p = rec.page; --- 179,183 ---- if (addr == BTree.KEY_NOT_FOUND) return false; ! DOMFile.RecordPos rec = db.findRecord(addr); page = rec.page.getPageNum(); p = rec.page; *************** *** 167,171 **** node = null; } else if (-1 < startAddress) { ! final DOMFile.RecordPos rec = db.findValuePosition(startAddress); page = rec.page.getPageNum(); offset = rec.offset - 2; --- 185,189 ---- node = null; } else if (-1 < startAddress) { ! final DOMFile.RecordPos rec = db.findRecord(startAddress); page = rec.page.getPageNum(); offset = rec.offset - 2; Index: StorageAddress.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/StorageAddress.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StorageAddress.java 29 Jan 2004 15:06:46 -0000 1.2 --- StorageAddress.java 14 Apr 2004 12:17:22 -0000 1.3 *************** *** 1,7 **** - /* - * StorageAddress.java - May 25, 2003 - * - * @author wolf - */ package org.exist.storage.store; --- 1,2 ---- Index: DOMFileIterator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/DOMFileIterator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DOMFileIterator.java 25 Nov 2003 12:54:15 -0000 1.3 --- DOMFileIterator.java 14 Apr 2004 12:17:21 -0000 1.4 *************** *** 16,22 **** /** ! * Class DOMFileIterator is used to iterate over nodes in the DOM storage. ! * This implementation returns the raw value of the node. You have to call ! * Node.deserialize() to read the node from the value data. * * The DOM file is locked to locate the data and released afterwards. Before --- 16,23 ---- /** ! * Iterate through all nodes of a document in the DOM storage. Returns the ! * raw data of the node in a {@link org.dbxml.core.data.Value}. Use class ! * {@link org.exist.storage.store.NodeIterator} to get node objects instead of ! * raw data. * * The DOM file is locked to locate the data and released afterwards. Before *************** *** 38,50 **** Object lockKey; - /** - * Constructor for the DOMFileIterator object - * - *@param doc Description of the Parameter - *@param db Description of the Parameter - *@param node Description of the Parameter - *@exception BTreeException Description of the Exception - *@exception IOException Description of the Exception - */ public DOMFileIterator(Object lock, DOMFile db, NodeProxy node) throws BTreeException, IOException { --- 39,42 ---- *************** *** 57,69 **** } - /** - * Constructor for the DOMFileIterator object - * - *@param doc Description of the Parameter - *@param db Description of the Parameter - *@param address Description of the Parameter - *@exception BTreeException Description of the Exception - *@exception IOException Description of the Exception - */ public DOMFileIterator(Object lock, DOMFile db, long address) throws BTreeException, IOException { --- 49,52 ---- *************** *** 96,135 **** return false; } ! if (node != null) { ! db.setOwnerObject(lockKey); ! long addr = db.findValue(lockKey, node); ! if (addr == BTree.KEY_NOT_FOUND) ! return false; ! final DOMFile.RecordPos rec = db.findValuePosition(addr); ! page = rec.page.getPageNum(); ! p = rec.page; ! offset = rec.offset - 2; ! node = null; ! } else if (-1 < startAddress) { ! final DOMFile.RecordPos rec = db.findValuePosition(startAddress); ! page = rec.page.getPageNum(); ! offset = rec.offset - 2; ! p = rec.page; ! } else if (page > -1) ! p = db.getCurrentPage(page); ! else { lock.release(); ! return false; ! } ! db.getPageBuffer().add(p); ! final DOMFilePageHeader ph = p.getPageHeader(); ! lock.release(); ! if (offset < ph.getDataLength()) ! return true; ! else if (ph.getNextDataPage() < 0) ! return false; ! else ! return true; } catch (BTreeException e) { LOG.warn(e); } catch (IOException e) { LOG.warn(e); } - lock.release(); return false; } --- 79,101 ---- return false; } ! if(gotoNextPosition()) { ! db.getPageBuffer().add(p); ! final DOMFilePageHeader ph = p.getPageHeader(); lock.release(); ! if (offset < ph.getDataLength()) ! return true; ! else if (ph.getNextDataPage() < 0) ! return false; ! else ! return true; ! } else ! return false; } catch (BTreeException e) { LOG.warn(e); } catch (IOException e) { LOG.warn(e); + } finally { + lock.release(); } return false; } *************** *** 148,203 **** return null; } ! // position the iterator at the start of the first value ! if (node != null) { ! db.setOwnerObject(lockKey); ! final long addr = db.findValue(lockKey, node); ! if (addr == BTree.KEY_NOT_FOUND) ! return null; ! DOMFile.RecordPos rec = db.findValuePosition(addr); ! page = rec.page.getPageNum(); ! p = rec.page; ! offset = rec.offset - 2; ! node = null; ! } else if (-1 < startAddress) { ! final DOMFile.RecordPos rec = db.findValuePosition(startAddress); ! page = rec.page.getPageNum(); ! offset = rec.offset - 2; ! p = rec.page; ! startAddress = -1; ! } else if (page > -1) ! p = db.getCurrentPage(page); ! else { ! lock.release(); ! return null; ! } ! final DOMFilePageHeader ph = p.getPageHeader(); ! // next value larger than length of the current page? ! if (offset >= ph.getDataLength()) { ! // load next page in chain ! final long nextPage = ph.getNextDataPage(); ! if (nextPage < 0) { ! LOG.debug("bad link to next " + p.page.getPageInfo()); ! lock.release(); ! return null; ! } ! page = nextPage; ! p = db.getCurrentPage(nextPage); ! offset = 0; } - // extract the value - lastTID = ByteConversion.byteToShort(p.data, offset); - short l = ByteConversion.byteToShort(p.data, offset + 2); - Value nextVal; - if(l == DOMFile.OVERFLOW) { - final long op = ByteConversion.byteToLong(p.data, offset + 4); - final byte[] data = db.getOverflowValue(op); - nextVal = new Value(data); - l = 8; - } else - nextVal = new Value(p.data, offset + 4, l); - nextVal.setAddress(StorageAddress.createPointer((int) page, lastTID)); - lastOffset = offset; - offset = offset + 4 + l; - lock.release(); return nextVal; } catch (BTreeException e) { --- 114,165 ---- return null; } ! Value nextVal = null; ! if(gotoNextPosition()) { ! do { ! DOMFilePageHeader ph = p.getPageHeader(); ! // next value larger than length of the current page? ! if (offset >= ph.getDataLength()) { ! // load next page in chain ! final long nextPage = ph.getNextDataPage(); ! if (nextPage < 0) { ! LOG.debug("bad link to next " + p.page.getPageInfo()); ! return null; ! } ! page = nextPage; ! p = db.getCurrentPage(nextPage); ! offset = 0; ! } ! lastOffset = offset; ! ! // extract tid ! lastTID = ByteConversion.byteToShort(p.data, offset); ! offset += 2; ! // check if this is just a link to a relocated node ! if(ItemId.isLink(lastTID)) { ! // skip this ! offset += 8; ! continue; ! } ! // read data length ! short l = ByteConversion.byteToShort(p.data, offset); ! offset += 2; ! if(ItemId.isRelocated(lastTID)) { ! // found a relocated node. Skip the next 8 bytes ! offset += 8; ! } ! if(l == DOMFile.OVERFLOW) { ! final long op = ByteConversion.byteToLong(p.data, offset); ! offset += 8; ! final byte[] data = db.getOverflowValue(op); ! nextVal = new Value(data); ! } else { ! nextVal = new Value(p.data, offset, l); ! offset += l; ! } ! nextVal.setAddress( ! StorageAddress.createPointer((int) page, ItemId.getId(lastTID)) ! ); ! } while(nextVal == null); } return nextVal; } catch (BTreeException e) { *************** *** 205,210 **** } catch (IOException e) { LOG.warn(e); } - lock.release(); return null; } --- 167,173 ---- } catch (IOException e) { LOG.warn(e); + } finally { + lock.release(); } return null; } *************** *** 222,229 **** lock.acquire(Lock.WRITE_LOCK); DOMPage p = db.getCurrentPage(page); ! short l = ByteConversion.byteToShort(p.data, lastOffset + 2); // if this is an overflow value, remove it if(l == DOMFile.OVERFLOW) { ! final long op = ByteConversion.byteToLong(p.data, lastOffset + 4); db.removeOverflowValue(op); } --- 185,209 ---- lock.acquire(Lock.WRITE_LOCK); DOMPage p = db.getCurrentPage(page); ! short itemId = ByteConversion.byteToShort(p.data, lastOffset); ! lastOffset += 2; ! short l = ByteConversion.byteToShort(p.data, lastOffset); ! lastOffset += 2; ! if(ItemId.isRelocated(itemId)) { ! long backLink = ByteConversion.byteToLong(p.data, lastOffset); ! lastOffset += 8; ! DOMFile.RecordPos origRec = db.findRecord(backLink, false); ! DOMFilePageHeader ph = origRec.page.getPageHeader(); ! ph.decRecordCount(); ! //LOG.debug("Removing link from " + StorageAddress.pageFromPointer(backLink) + "; count=" + ph.getRecordCount()); ! origRec.page.setDirty(true); ! if(ph.getRecordCount() == 0) { ! //LOG.debug("Removing linked page: " + origRec.page.getPageNum()); ! db.removePage(origRec.page); ! } ! } // if this is an overflow value, remove it if(l == DOMFile.OVERFLOW) { ! final long op = ByteConversion.byteToLong(p.data, lastOffset); ! lastOffset += 8; db.removeOverflowValue(op); } *************** *** 232,259 **** DOMFilePageHeader ph = p.getPageHeader(); ph.decRecordCount(); p.setDirty(true); // if record count == 0, remove the page if (ph.getRecordCount() == 0) { long np = ph.getNextDataPage(); ! try { ! if (np > -1) { ! DOMPage next = db.getCurrentPage(np); ! next.getPageHeader().prevDataPage = -1; ! db.getPageBuffer().add(next); ! } ! ph.setNextDataPage(-1); ! ph.setPrevDataPage(-1); ! ph.setDataLength(0); ! //ph.setNextTID((short)0); ! ph.setRecordCount((short) 0); ! p.setDirty(true); ! db.getPageBuffer().remove(p); ! db.unlinkPages(p.page); ! } catch (IOException ioe) { ! LOG.warn(ioe); ! } page = np; offset = 0; ! } } catch (LockException e) { LOG.warn(e); --- 212,225 ---- DOMFilePageHeader ph = p.getPageHeader(); ph.decRecordCount(); + //LOG.debug("removed value from " + p.getPageNum() + "; size=" + ph.getRecordCount()); p.setDirty(true); // if record count == 0, remove the page if (ph.getRecordCount() == 0) { long np = ph.getNextDataPage(); ! db.removePage(p); page = np; offset = 0; ! } else ! db.getPageBuffer().add(p); } catch (LockException e) { LOG.warn(e); *************** *** 263,266 **** --- 229,261 ---- } + private boolean gotoNextPosition() throws BTreeException, IOException { + if (node != null) { + db.setOwnerObject(lockKey); + long addr = db.findValue(lockKey, node); + if (addr == BTree.KEY_NOT_FOUND) + return false; + DOMFile.RecordPos rec = db.findRecord(addr); + if(rec != null) { + page = rec.page.getPageNum(); + p = rec.page; + offset = rec.offset - 2; + node = null; + } else + return false; + } else if (-1 < startAddress) { + DOMFile.RecordPos rec = db.findRecord(startAddress); + if(rec != null) { + page = rec.page.getPageNum(); + offset = rec.offset - 2; + p = rec.page; + startAddress = -1; + return true; + } else + return false; + } else if (page > -1) + p = db.getCurrentPage(page); + return true; + } + /** * Reposition the iterator at the address of the proxy node. --- NEW FILE: ItemId.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-03 Wolfgang M. Meier * wol...@ex... * http://exist.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: ItemId.java,v 1.1 2004/04/14 12:17:22 wolfgang_m Exp $ */ package org.exist.storage.store; class ItemId { public static final short RELOCATED_MASK = (short) 0x8000; public static final short LINK_MASK = (short) 0x4000; public static final short ID_MASK = (short) 0x3FFF; public final static short getId(short id) { return (short) (id & ID_MASK); } public final static short setIsRelocated(short id) { return (short)(id | RELOCATED_MASK); } public final static boolean isLink(short id) { return (id & LINK_MASK) != 0; } public final static short setIsLink(short id) { return (short) (id | LINK_MASK); } public final static boolean isRelocated(short id) { return (id & RELOCATED_MASK) != 0; } } |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:18:02
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/dom Modified Files: ExtArrayNodeSet.java NodeProxy.java VirtualNodeSet.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: NodeProxy.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/NodeProxy.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** NodeProxy.java 25 Feb 2004 15:31:58 -0000 1.25 --- NodeProxy.java 14 Apr 2004 12:17:22 -0000 1.26 *************** *** 85,88 **** --- 85,89 ---- private ContextItem context = null; + private long internalAddress = -1; *************** *** 290,294 **** public static class NodeProxyComparator implements Comparator { ! public static NodeProxyComparator instance = new NodeProxyComparator(); public int compare(Object obj1, Object obj2) { --- 291,295 ---- public static class NodeProxyComparator implements Comparator { ! public final static NodeProxyComparator instance = new NodeProxyComparator(); public int compare(Object obj1, Object obj2) { Index: VirtualNodeSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/VirtualNodeSet.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** VirtualNodeSet.java 29 Jan 2004 15:06:46 -0000 1.32 --- VirtualNodeSet.java 14 Apr 2004 12:17:22 -0000 1.33 *************** *** 57,63 **** protected boolean useSelfAsContext = false; - private int lastDocAdded = -1; - private int sizeHint = -1; - public VirtualNodeSet(int axis, NodeTest test, NodeSet context) { this.axis = axis; --- 57,60 ---- Index: ExtArrayNodeSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/ExtArrayNodeSet.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ExtArrayNodeSet.java 25 Mar 2004 12:50:49 -0000 1.13 --- ExtArrayNodeSet.java 14 Apr 2004 12:17:22 -0000 1.14 *************** *** 139,143 **** public Iterator iterator() { sort(); ! return new ExtArrayIterator(); } --- 139,143 ---- public Iterator iterator() { sort(); ! return new ExtArrayIterator(map); } *************** *** 149,153 **** public SequenceIterator iterate() { sortInDocumentOrder(); ! return new ExtArrayIterator(); } --- 149,153 ---- public SequenceIterator iterate() { sortInDocumentOrder(); ! return new ExtArrayIterator(map); } *************** *** 159,163 **** public SequenceIterator unorderedIterator() { sort(); ! return new ExtArrayIterator(); } --- 159,163 ---- public SequenceIterator unorderedIterator() { sort(); ! return new ExtArrayIterator(map); } *************** *** 618,622 **** } } ! private class ExtArrayIterator implements Iterator, SequenceIterator { Iterator docsIterator; --- 618,622 ---- } } ! private static class ExtArrayIterator implements Iterator, SequenceIterator { Iterator docsIterator; *************** *** 625,629 **** NodeProxy next = null; ! ExtArrayIterator() { docsIterator = map.valueIterator(); if (docsIterator.hasNext()) --- 625,629 ---- NodeProxy next = null; ! ExtArrayIterator(Int2ObjectHashMap map) { docsIterator = map.valueIterator(); if (docsIterator.hasNext()) |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:18:01
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/storage Modified Files: NativeTextEngine.java NativeBroker.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: NativeBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeBroker.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** NativeBroker.java 29 Mar 2004 14:15:14 -0000 1.61 --- NativeBroker.java 14 Apr 2004 12:17:21 -0000 1.62 *************** *** 109,113 **** /** check available memory after storing MEM_LIMIT_CHECK nodes */ ! protected static int MEM_LIMIT_CHECK = 10000; protected CollectionStore collectionsDb = null; --- 109,113 ---- /** check available memory after storing MEM_LIMIT_CHECK nodes */ ! protected final static int MEM_LIMIT_CHECK = 10000; protected CollectionStore collectionsDb = null; *************** *** 340,344 **** val[1].data(), val[1].start(), ! val[1].length()); try { while (is.available() > 0) { --- 340,344 ---- val[1].data(), val[1].start(), ! val[1].getLength()); try { while (is.available() > 0) { *************** *** 869,872 **** --- 869,878 ---- } + /** + * Index a single node, which has been added through an XUpdate + * operation. This method is only called if inserting the node is possible + * without changing the node identifiers of sibling or parent nodes. In other + * cases, reindex will be called. + */ public void index(final NodeImpl node) { final DocumentImpl doc = (DocumentImpl) node.getOwnerDocument(); *************** *** 938,941 **** --- 944,952 ---- } + /** + * Reindex the nodes in the document. This method will either reindex all + * descendant nodes of the passed node, or all nodes below some level of + * the document if node is null. + */ public void reindex(DocumentImpl oldDoc, DocumentImpl doc, NodeImpl node) { int idxLevel = doc.reindexRequired(); *************** *** 948,952 **** LOG.debug("reindexing level " + idxLevel + " of document " + doc.getDocId()); final long start = System.currentTimeMillis(); ! // remove old dom index Value ref = new NodeRef(doc.getDocId()); final IndexQuery query = new IndexQuery(IndexQuery.TRUNC_RIGHT, ref); --- 959,963 ---- LOG.debug("reindexing level " + idxLevel + " of document " + doc.getDocId()); final long start = System.currentTimeMillis(); ! // remove all old index keys from the btree Value ref = new NodeRef(doc.getDocId()); final IndexQuery query = new IndexQuery(IndexQuery.TRUNC_RIGHT, ref); *************** *** 981,985 **** lock.release(); } ! // reindex the nodes Iterator iterator; if (node == null) { --- 992,996 ---- lock.release(); } ! // now reindex the nodes Iterator iterator; if (node == null) { *************** *** 1007,1010 **** --- 1018,1028 ---- } + /** + * Reindex the given node after the DOM tree has been + * modified by an XUpdate. + * + * @param node + * @param currentPath + */ private void reindex(final NodeImpl node, StringBuffer currentPath) { if (node.getGID() < 0) *************** *** 1089,1092 **** --- 1107,1118 ---- } + /** + * Called by reindex to walk through all nodes in the tree and reindex them + * if necessary. + * + * @param iterator + * @param node + * @param currentPath + */ private void scanNodes(Iterator iterator, NodeImpl node, StringBuffer currentPath) { if (node.getNodeType() == Node.ELEMENT_NODE) *************** *** 1107,1112 **** } final long lastChildId = firstChildId + node.getChildCount(); - // ong p; - // Value value; NodeImpl child; for (long gid = firstChildId; gid < lastChildId; gid++) { --- 1133,1136 ---- *************** *** 1859,1866 **** final int percent = (int) (run.freeMemory() / (run.totalMemory() / 100)); if (percent < memMinFree) { ! LOG.info( ! "total memory: " + run.totalMemory() + "; free: " + run.freeMemory()); flush(); ! System.gc(); LOG.info( "total memory: " + run.totalMemory() + "; free: " + run.freeMemory()); --- 1883,1890 ---- final int percent = (int) (run.freeMemory() / (run.totalMemory() / 100)); if (percent < memMinFree) { ! //LOG.info( ! // "total memory: " + run.totalMemory() + "; free: " + run.freeMemory()); flush(); ! //System.gc(); LOG.info( "total memory: " + run.totalMemory() + "; free: " + run.freeMemory()); *************** *** 2041,2045 **** LOG.debug(dbe); } - System.gc(); } --- 2065,2068 ---- *************** *** 2061,2069 **** new DOMTransaction(this, domDb, Lock.WRITE_LOCK) { public Object start() throws ReadOnlyException { - final NodeRef ref = new NodeRef(doc.getDocId(), node.getGID()); if (-1 < internalAddress) ! domDb.update(ref, internalAddress, data); ! else ! domDb.update(ref, data); return null; } --- 2084,2092 ---- new DOMTransaction(this, domDb, Lock.WRITE_LOCK) { public Object start() throws ReadOnlyException { if (-1 < internalAddress) ! domDb.update(internalAddress, data); ! else { ! domDb.update(new NodeRef(doc.getDocId(), node.getGID()), data); ! } return null; } *************** *** 2082,2085 **** --- 2105,2111 ---- } + /** + * Physically insert a node into the DOM storage. + */ public void insertAfter(final NodeImpl previous, final NodeImpl node) { final byte data[] = node.serialize(); Index: NativeTextEngine.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeTextEngine.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** NativeTextEngine.java 5 Mar 2004 16:15:47 -0000 1.42 --- NativeTextEngine.java 14 Apr 2004 12:17:21 -0000 1.43 *************** *** 780,784 **** private DocumentImpl doc = null; - private boolean flushed = false; private Map words[] = new TreeMap[2]; private VariableByteOutputStream os = new VariableByteOutputStream(7); --- 780,783 ---- *************** *** 1098,1109 **** if (data.size() == 0) return; - // if data has already been written to the table, - // we may need to do updates. - final WordRef ref = new WordRef(collectionId, word); Lock lock = dbWords.getLock(); try { lock.acquire(Lock.WRITE_LOCK); try { ! dbWords.append(ref, data); } catch (ReadOnlyException e) { } catch (IOException ioe) { --- 1097,1105 ---- if (data.size() == 0) return; Lock lock = dbWords.getLock(); try { lock.acquire(Lock.WRITE_LOCK); try { ! dbWords.append(new WordRef(collectionId, word), data); } catch (ReadOnlyException e) { } catch (IOException ioe) { |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:18:00
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/util Modified Files: ByteConversion.java Configuration.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: Configuration.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/util/Configuration.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Configuration.java 29 Jan 2004 15:06:49 -0000 1.14 --- Configuration.java 14 Apr 2004 12:17:21 -0000 1.15 *************** *** 23,31 **** import java.io.File; import java.io.FileInputStream; - import java.io.FileReader; import java.io.IOException; import java.io.InputStream; - import java.io.InputStreamReader; - import java.io.Reader; import java.util.HashMap; import java.util.Map; --- 23,28 ---- *************** *** 125,137 **** config.put( "indexer.indexNumbers", ! new Boolean(parseNum.equals("yes"))); if (stemming != null) ! config.put("indexer.stem", new Boolean(stemming.equals("yes"))); if (caseSensitive != null) config.put( "indexer.case-sensitive", ! new Boolean(caseSensitive.equals("yes"))); if (suppressWS != null) --- 122,134 ---- config.put( "indexer.indexNumbers", ! Boolean.valueOf(parseNum.equals("yes"))); if (stemming != null) ! config.put("indexer.stem", Boolean.valueOf(stemming.equals("yes"))); if (caseSensitive != null) config.put( "indexer.case-sensitive", ! Boolean.valueOf(caseSensitive.equals("yes"))); if (suppressWS != null) Index: ByteConversion.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/util/ByteConversion.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ByteConversion.java 9 Sep 2003 07:29:03 -0000 1.2 --- ByteConversion.java 14 Apr 2004 12:17:21 -0000 1.3 *************** *** 133,144 **** } - - /** - * Description of the Method - * - *@param data Description of the Parameter - *@param start Description of the Parameter - *@return Description of the Return Value - */ public final static short byteToShort( final byte[] data, final int start ) { return (short) ( ( ( data[start + 1] & 0xff ) << 8 ) | --- 133,136 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:35
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/backup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/backup Modified Files: Backup.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: Backup.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/backup/Backup.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Backup.java 29 Jan 2004 15:06:48 -0000 1.12 --- Backup.java 14 Apr 2004 12:17:24 -0000 1.13 *************** *** 1,5 **** /* * eXist Open Source Native XML Database ! * Copyright (C) 2001 Wolfgang M. Meier * wol...@ex... * http://exist.sourceforge.net --- 1,5 ---- /* * eXist Open Source Native XML Database ! * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist.sourceforge.net *************** *** 176,189 **** os.close(); } else { ! writer = ! new BufferedWriter( ! new OutputStreamWriter(os, "UTF-8")); ! // write resource to contentSerializer ! contentSerializer = SAXSerializerPool.getInstance().borrowSAXSerializer(); ! contentSerializer.setWriter(writer); ! contentSerializer.setOutputProperties(defaultOutputProperties); ! ((XMLResource)resource).getContentAsSAX(contentSerializer); ! SAXSerializerPool.getInstance().returnSAXSerializer(contentSerializer); ! writer.close(); } --- 176,195 ---- os.close(); } else { ! try { ! writer = ! new BufferedWriter( ! new OutputStreamWriter(os, "UTF-8")); ! // write resource to contentSerializer ! contentSerializer = SAXSerializerPool.getInstance().borrowSAXSerializer(); ! contentSerializer.setWriter(writer); ! contentSerializer.setOutputProperties(defaultOutputProperties); ! ((XMLResource)resource).getContentAsSAX(contentSerializer); ! SAXSerializerPool.getInstance().returnSAXSerializer(contentSerializer); ! writer.close(); ! } catch(Exception e) { ! System.err.println("An exception occurred while writing the resource: " + e.getMessage()); ! e.printStackTrace(); ! continue; ! } } |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:35
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/security In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/security Modified Files: SecurityManager.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: SecurityManager.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/security/SecurityManager.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SecurityManager.java 2 Feb 2004 15:30:39 -0000 1.15 --- SecurityManager.java 14 Apr 2004 12:17:24 -0000 1.16 *************** *** 175,179 **** LOG.debug("user " + user.getName() + " removed"); else ! LOG.debug("user "+ user.getName() + " not found"); DBBroker broker = null; try { --- 175,179 ---- LOG.debug("user " + user.getName() + " removed"); else ! LOG.debug("user not found"); DBBroker broker = null; try { |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:35
|
Update of /cvsroot/exist/eXist-1.0/src/org/dbxml/core/indexer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/dbxml/core/indexer Modified Files: IndexQuery.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: IndexQuery.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/indexer/IndexQuery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IndexQuery.java 13 Jun 2003 10:29:46 -0000 1.2 --- IndexQuery.java 14 Apr 2004 12:17:25 -0000 1.3 *************** *** 53,56 **** --- 53,57 ---- import org.dbxml.core.data.*; + import java.util.*; |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:34
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/xquery/parser Modified Files: XQuery.g Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: XQuery.g =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser/XQuery.g,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** XQuery.g 8 Mar 2004 11:21:22 -0000 1.6 --- XQuery.g 14 Apr 2004 12:17:25 -0000 1.7 *************** *** 1776,1780 **** String namespaceURI= context.getURIForPrefix(nc3.getText()); if (namespaceURI == null) ! throw new EXistException("No namespace defined for prefix " + nc.getText()); qname= new QName(null, namespaceURI, null); } --- 1776,1780 ---- String namespaceURI= context.getURIForPrefix(nc3.getText()); if (namespaceURI == null) ! throw new EXistException("No namespace defined for prefix " + nc3.getText()); qname= new QName(null, namespaceURI, null); } |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:33
|
Update of /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/dbxml/core/filer Modified Files: BTree.java Paged.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: Paged.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer/Paged.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Paged.java 5 Apr 2004 11:19:28 -0000 1.22 --- Paged.java 14 Apr 2004 12:17:23 -0000 1.23 *************** *** 457,461 **** byte[] data = value.getData(); PageHeader hdr = page.getPageHeader(); - hdr.setRecordLen(value.getLength()); hdr.dataLen = fileHeader.workSize; if (data.length < hdr.dataLen) --- 457,460 ---- *************** *** 976,997 **** } ! public abstract class PageHeader { private int dataLen = 0; private boolean dirty = false; private long nextPage = -1; - private int recordLen = 0; private byte status = UNUSED; - /** Constructor for the PageHeader object */ public PageHeader() { } - /** - * Constructor for the PageHeader object - * - *@param dis Description of the Parameter - *@exception IOException Description of the Exception - */ public PageHeader(byte[] data, int offset) throws IOException { read(data, offset); --- 975,989 ---- } ! public static abstract class PageHeader { ! private int dataLen = 0; private boolean dirty = false; private long nextPage = -1; private byte status = UNUSED; public PageHeader() { } public PageHeader(byte[] data, int offset) throws IOException { read(data, offset); *************** *** 1017,1029 **** /** - * The length of the Record's value - * - *@return The recordLen value - */ - public final int getRecordLen() { - return recordLen; - } - - /** * The status of this page (UNUSED, RECORD, DELETED, etc...) * --- 1009,1012 ---- *************** *** 1043,1058 **** } - /** - * Description of the Method - * - *@param dis Description of the Parameter - *@exception IOException Description of the Exception - */ public int read(byte[] data, int offset) throws IOException { status = data[offset++]; dataLen = ByteConversion.byteToInt(data, offset); offset += 4; - recordLen = ByteConversion.byteToInt(data, offset); - offset += 4; nextPage = ByteConversion.byteToLong(data, offset); offset += 8; --- 1026,1033 ---- *************** *** 1070,1078 **** } - /** - * Sets the dirty attribute of the PageHeader object - * - *@param dirty The new dirty value - */ public final void setDirty(boolean dirty) { this.dirty = dirty; --- 1045,1048 ---- *************** *** 1090,1103 **** /** - * The length of the Record's value - * - *@param recordLen The new recordLen value - */ - public void setRecordLen(int recordLen) { - this.recordLen = recordLen; - dirty = true; - } - - /** * The status of this page (UNUSED, RECORD, DELETED, etc...) * --- 1060,1063 ---- *************** *** 1109,1124 **** } - /** - * Description of the Method - * - *@param dos Description of the Parameter - *@exception IOException Description of the Exception - */ public int write(byte[] data, int offset) throws IOException { data[offset++] = status; ByteConversion.intToByte(dataLen, data, offset); offset += 4; - ByteConversion.intToByte(recordLen, data, offset); - offset += 4; ByteConversion.longToByte(nextPage, data, offset); offset += 8; --- 1069,1076 ---- Index: BTree.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer/BTree.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** BTree.java 5 Apr 2004 11:19:28 -0000 1.22 --- BTree.java 14 Apr 2004 12:17:23 -0000 1.23 *************** *** 51,57 **** */ import java.io.ByteArrayInputStream; - import java.io.ByteArrayOutputStream; import java.io.DataInputStream; - import java.io.DataOutputStream; import java.io.EOFException; import java.io.File; --- 51,55 ---- *************** *** 69,73 **** import org.exist.util.ByteConversion; import org.exist.util.VariableByteInputStream; - import org.exist.util.VariableByteOutputStream; /** --- 67,70 ---- *************** *** 116,125 **** } - public BTree(File file, short keyLen) { - this(); - setFile(file); - fileHeader.setKeyLen(keyLen); - } - public BTree(File file) { this(); --- 113,116 ---- *************** *** 450,457 **** */ private void adjustDataLen(Value value) { ! currentDataLen += 8; if(fileHeader.getFixedKeyLen() < 0) currentDataLen += 2; - currentDataLen += value.getLength(); } --- 441,449 ---- */ private void adjustDataLen(Value value) { ! if(currentDataLen < 0) ! recalculateDataLen(); ! currentDataLen += value.getLength() + 8; if(fileHeader.getFixedKeyLen() < 0) currentDataLen += 2; } *************** *** 556,602 **** } - public void __write() throws IOException { - VariableByteOutputStream os = - new VariableByteOutputStream(); - - // Write out the values - for (int i = 0; i < values.length; i++) { - if (fileHeader.getFixedKeyLen() < 0) - os.writeShort(values[i].getLength()); - values[i].streamTo(os); - } - - // write out the pointers - for (int i = 0; i < ptrs.length; i++) - os.writeLong(ptrs[i]); - - byte[] temp = os.toByteArray(); - writeValue(page, new Value(temp)); - - saved = true; - } - - public void _write() throws IOException { - ByteArrayOutputStream bos = new ByteArrayOutputStream((int) fileHeader.getWorkSize()); - DataOutputStream os = new DataOutputStream(bos); - - // Write out the Values - for (int i = 0; i < values.length; i++) { - if (fileHeader.getFixedKeyLen() < 0) - os.writeShort(values[i].getLength()); - values[i].streamTo(os); - } - - // Write out the pointers - for (int i = 0; i < ptrs.length; i++) - os.writeLong(ptrs[i]); - byte[] temp = bos.toByteArray(); - writeValue(page, new Value(temp)); - - //if (fileHeader.isDirty()) - // fileHeader.write(); - saved = true; - } - public void write() throws IOException { final byte[] temp = new byte[fileHeader.getWorkSize()]; --- 548,551 ---- *************** *** 610,613 **** --- 559,564 ---- } data = values[i].getData(); + if(p + data.length > temp.length) + throw new IOException("calculated: " + getDataLen() + "; required: " + (p + data.length)); System.arraycopy(data, 0, temp, p, data.length); p += data.length; *************** *** 675,680 **** long oldPtr = ptrs[idx]; ptrs[idx] = pointer; - - setValues(values); setPointers(ptrs); //write(); --- 626,629 ---- *************** *** 686,691 **** setValues(insertArrayValue(values, value, idx)); - adjustDataLen(value); setPointers(insertArrayLong(ptrs, pointer, idx)); if (getDataLen() > fileHeader.getWorkSize()) split(); --- 635,641 ---- setValues(insertArrayValue(values, value, idx)); setPointers(insertArrayLong(ptrs, pointer, idx)); + adjustDataLen(value); + //recalculateDataLen(); if (getDataLen() > fileHeader.getWorkSize()) split(); *************** *** 1264,1268 **** protected class BTreeFileHeader extends FileHeader { private long rootPage = 0; - private short keyLen = -1; private int nodePageCount = 0; private short fixedLen = -1; --- 1214,1217 ---- *************** *** 1295,1299 **** super.read(raf); rootPage = raf.readLong(); - keyLen = raf.readShort(); fixedLen = raf.readShort(); nodePageCount = raf.readInt(); --- 1244,1247 ---- *************** *** 1303,1307 **** super.write(raf); raf.writeLong(rootPage); - raf.writeShort(keyLen); raf.writeShort(fixedLen); raf.writeInt(nodePageCount); --- 1251,1254 ---- *************** *** 1327,1338 **** } - public short getKeyLen() { - return keyLen; - } - - public void setKeyLen(short keyLen) { - this.keyLen = keyLen; - } - public short getFixedKeyLen() { return fixedLen; --- 1274,1277 ---- *************** *** 1352,1356 **** } ! protected class BTreePageHeader extends PageHeader { private short valueCount = 0; --- 1291,1295 ---- } ! protected static class BTreePageHeader extends PageHeader { private short valueCount = 0; |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:33
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/client Modified Files: InteractiveClient.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: InteractiveClient.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/client/InteractiveClient.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** InteractiveClient.java 18 Feb 2004 15:36:10 -0000 1.25 --- InteractiveClient.java 14 Apr 2004 12:17:24 -0000 1.26 *************** *** 1845,1849 **** } } - return; } else if (doParse) { if (!foundCollection) { --- 1845,1848 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:33
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/http/servlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/http/servlets Modified Files: XQueryServlet.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: XQueryServlet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** XQueryServlet.java 5 Mar 2004 11:15:29 -0000 1.6 --- XQueryServlet.java 14 Apr 2004 12:17:24 -0000 1.7 *************** *** 279,289 **** private String readQuery(File source) throws IOException { ! Reader reader = new InputStreamReader(new FileInputStream(source), encoding); ! char[] chars = new char[1024]; ! StringBuffer buf = new StringBuffer(); ! int read; ! while((read = reader.read(chars)) > -1) ! buf.append(chars, 0, read); ! return buf.toString(); } --- 279,294 ---- private String readQuery(File source) throws IOException { ! FileInputStream is = new FileInputStream(source); ! try { ! Reader reader = new InputStreamReader(is, encoding); ! char[] chars = new char[1024]; ! StringBuffer buf = new StringBuffer(); ! int read; ! while((read = reader.read(chars)) > -1) ! buf.append(chars, 0, read); ! return buf.toString(); ! } finally { ! is.close(); ! } } |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:33
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/cocoon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/cocoon Modified Files: XQueryGenerator.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: XQueryGenerator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/cocoon/XQueryGenerator.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** XQueryGenerator.java 5 Mar 2004 11:15:28 -0000 1.11 --- XQueryGenerator.java 14 Apr 2004 12:17:24 -0000 1.12 *************** *** 261,265 **** os.write(t, 0, count); } ! return new String(os.toString("UTF-8")); } --- 261,265 ---- os.write(t, 0, count); } ! return os.toString("UTF-8"); } |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:33
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/xupdate Modified Files: Modification.java Append.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: Modification.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/Modification.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Modification.java 29 Jan 2004 15:06:45 -0000 1.19 --- Modification.java 14 Apr 2004 12:17:23 -0000 1.20 *************** *** 74,78 **** AST ast = parser.getAST(); - LOG.debug("generated AST: " + ast.toStringTree()); PathExpr expr = new PathExpr(context); --- 74,77 ---- Index: Append.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xupdate/Append.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Append.java 29 Jan 2004 15:06:45 -0000 1.11 --- Append.java 14 Apr 2004 12:17:23 -0000 1.12 *************** *** 13,17 **** /** ! * Append.java * * @author Wolfgang Meier --- 13,17 ---- /** ! * Implements an XUpate append statement. * * @author Wolfgang Meier *************** *** 26,29 **** --- 26,30 ---- super(broker, docs, selectStmt); } + /** * @see org.exist.xupdate.Modification#process() |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:31
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/xquery Modified Files: XQueryContext.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: XQueryContext.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/XQueryContext.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XQueryContext.java 25 Mar 2004 12:50:50 -0000 1.9 --- XQueryContext.java 14 Apr 2004 12:17:23 -0000 1.10 *************** *** 369,373 **** modules.put(module.getNamespaceURI(), module); ! LOG.debug("module " + module.getNamespaceURI() + " loaded successfully."); } catch (ClassNotFoundException e) { LOG.warn("module class " + moduleClass + " not found. Skipping..."); --- 369,373 ---- modules.put(module.getNamespaceURI(), module); ! //LOG.debug("module " + module.getNamespaceURI() + " loaded successfully."); } catch (ClassNotFoundException e) { LOG.warn("module class " + moduleClass + " not found. Skipping..."); |
From: Wolfgang M. M. <wol...@us...> - 2004-04-14 12:17:31
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/analysis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20167/src/org/exist/storage/analysis Modified Files: SimpleTokenizer.java TextToken.java Log Message: Improved page organization in dom.dbx to fix known XUpdate issues. Index: TextToken.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/analysis/TextToken.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TextToken.java 13 Jun 2003 10:34:58 -0000 1.2 --- TextToken.java 14 Apr 2004 12:17:23 -0000 1.3 *************** *** 1,10 **** package org.exist.storage.analysis; - /** - * Description of the Class - * - *@author Wolfgang Meier <me...@if...> - *@created 10. Oktober 2002 - */ public class TextToken { --- 1,5 ---- + package org.exist.storage.analysis; public class TextToken { *************** *** 25,29 **** public final static TextToken EOF_TOKEN = new TextToken(EOF); - /** Description of the Field */ public final static String[] types = {"letter", "digit", "whitespace", "number", --- 20,23 ---- *************** *** 98,122 **** } ! /** Description of the Method */ public void consumeNext() { end++; } - - /** - * Gets the char attribute of the Token object - * - *@return The char value - */ public char getChar() { return tokenText.charAt( start ); } - - /** - * Gets the text attribute of the Token object - * - *@return The text value - */ public String getText() { if(start >= tokenText.length() || end > tokenText.length()) --- 92,107 ---- } ! /** ! * Consume the next character in the current buffer by incrementing ! * the end offset. ! */ public void consumeNext() { end++; } public char getChar() { return tokenText.charAt( start ); } public String getText() { if(start >= tokenText.length() || end > tokenText.length()) *************** *** 126,149 **** } - - /** - * Gets the type attribute of the Token object - * - *@return The type value - */ public int getType() { return tokenType; } - public void setType( int type ) { tokenType = type; } - /** - * Sets the text attribute of the Token object - * - *@param text The new text value - */ public void setText( String text ) { tokenText = text; --- 111,122 ---- Index: SimpleTokenizer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/analysis/SimpleTokenizer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SimpleTokenizer.java 31 Mar 2004 12:22:07 -0000 1.7 --- SimpleTokenizer.java 14 Apr 2004 12:17:23 -0000 1.8 *************** *** 12,16 **** public class SimpleTokenizer implements Tokenizer { private int pos = 0; - private int previous = 0; private boolean stem = false; private CharSequence text; --- 12,15 ---- *************** *** 46,51 **** if (ch == '\\' && isWildcard(LA(2))) { break; ! } ! if (singleCharToken(ch)) { // if this is a single char token and first in the sequence, // consume it --- 45,49 ---- if (ch == '\\' && isWildcard(LA(2))) { break; ! } else if (ch > '\u2E80' && singleCharToken(ch)) { // if this is a single char token and first in the sequence, // consume it |
From: Denis L. - A. <den...@ac...> - 2004-04-13 14:08:52
|
Hi, I would like to know if eXist is stable enough to be used in a live environment? Thank you very much, Denis Louvegnies |
From: Wolfgang M. M. <wol...@us...> - 2004-04-05 11:32:12
|
Update of /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29682/src/org/dbxml/core/filer Modified Files: BTree.java Paged.java Log Message: Avoid recalculation of btree node data size on every update. Instead, use a private field for the size and update it only if required. Index: Paged.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer/Paged.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Paged.java 30 Mar 2004 16:56:32 -0000 1.21 --- Paged.java 5 Apr 2004 11:19:28 -0000 1.22 *************** *** 76,80 **** protected final static byte UNUSED = 0; ! public static int PAGE_SIZE = 4096; private RandomAccessFile raf; --- 76,80 ---- protected final static byte UNUSED = 0; ! protected static int PAGE_SIZE = 4096; private RandomAccessFile raf; *************** *** 86,91 **** private byte[] tempPageData = null; private byte[] tempHeaderData = null; - - private long lastPage = -1; public Paged() { --- 86,89 ---- *************** *** 342,347 **** */ protected final Page getPage(long pageNum) throws IOException { ! final Page p = new Page(pageNum); ! return p; } --- 340,344 ---- */ protected final Page getPage(long pageNum) throws IOException { ! return new Page(pageNum); } Index: BTree.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer/BTree.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** BTree.java 29 Mar 2004 14:15:13 -0000 1.21 --- BTree.java 5 Apr 2004 11:19:28 -0000 1.22 *************** *** 68,72 **** import org.exist.storage.cache.LRDCache; import org.exist.util.ByteConversion; - import org.exist.util.VariableByteCoding; import org.exist.util.VariableByteInputStream; import org.exist.util.VariableByteOutputStream; --- 68,71 ---- *************** *** 337,349 **** protected final class BTreeNode implements Cacheable { ! public Page page; private BTreePageHeader ph; private Value[] values = null; private long[] ptrs = null; private BTreeNode parent = null; private int refCount = 0; private int timestamp = 0; ! protected boolean saved = true; public BTreeNode(Page page) { this.page = page; --- 336,353 ---- protected final class BTreeNode implements Cacheable { ! private Page page; private BTreePageHeader ph; + private Value[] values = null; private long[] ptrs = null; + private BTreeNode parent = null; private int refCount = 0; private int timestamp = 0; ! ! private boolean saved = true; + private int currentDataLen = -1; + public BTreeNode(Page page) { this.page = page; *************** *** 415,443 **** } ! private final int _calcDataLen() { ! int length = 0; ! if (ptrs != null) { ! for (int i = 0; i < ptrs.length; i++) { ! length += VariableByteCoding.getSize(ptrs[i]); ! } ! } ! //length = ptrs.length * 8; ! for (int i = 0; i < values.length; i++) ! length = ! length + values[i].getLength() + ((fileHeader.getFixedKeyLen() < 0) ? 2 : 0); ! return length; } ! ! private int calcDataLen() { ! int length = ptrs == null ? 0 : ptrs.length << 3; if(fileHeader.getFixedKeyLen() < 0) ! length += 2 * values.length; for (int i = 0; i < values.length; i++) ! length += values[i].getLength(); ! return length; } private boolean mustSplit() { ! return calcDataLen() > fileHeader.getWorkSize(); } --- 419,461 ---- } ! /** ! * Returns the raw data size (in bytes) required by this node. ! * ! * @return ! */ ! private int getDataLen() { ! return currentDataLen < 0 ? recalculateDataLen() : ! currentDataLen; } ! ! /** ! * Recalculates the raw data size (in bytes) required by this node. ! * ! * @return ! */ ! private int recalculateDataLen() { ! currentDataLen = ptrs == null ? 0 : ptrs.length << 3; if(fileHeader.getFixedKeyLen() < 0) ! currentDataLen += 2 * values.length; for (int i = 0; i < values.length; i++) ! currentDataLen += values[i].getLength(); ! return currentDataLen; ! } ! ! /** ! * Add the raw data size required to store the value to the internal ! * data size of this node. ! * ! * @param value ! */ ! private void adjustDataLen(Value value) { ! currentDataLen += 8; ! if(fileHeader.getFixedKeyLen() < 0) ! currentDataLen += 2; ! currentDataLen += value.getLength(); } private boolean mustSplit() { ! return getDataLen() > fileHeader.getWorkSize(); } *************** *** 635,639 **** setValues(deleteArrayValue(values, idx)); setPointers(deleteArrayLong(ptrs, idx)); ! //cache.add(this); return oldPtr; } --- 653,657 ---- setValues(deleteArrayValue(values, idx)); setPointers(deleteArrayLong(ptrs, idx)); ! recalculateDataLen(); return oldPtr; } *************** *** 667,680 **** idx = - (idx + 1); ! setValues(insertArrayValue(values, value.trim(), ! //new Value(value.getData()), ! idx)); setPointers(insertArrayLong(ptrs, pointer, idx)); ! //cache.add(this); ! boolean split = calcDataLen() > fileHeader.getWorkSize(); ! if (split) split(); - - //write(); } return -1; --- 685,693 ---- idx = - (idx + 1); ! setValues(insertArrayValue(values, value, idx)); ! adjustDataLen(value); setPointers(insertArrayLong(ptrs, pointer, idx)); ! if (getDataLen() > fileHeader.getWorkSize()) split(); } return -1; *************** *** 692,697 **** setValues(insertArrayValue(values, value, idx)); setPointers(insertArrayLong(ptrs, rightPointer, idx + 1)); ! //cache.add(this); ! boolean split = calcDataLen() > fileHeader.getWorkSize(); if (split) --- 705,709 ---- setValues(insertArrayValue(values, value, idx)); setPointers(insertArrayLong(ptrs, rightPointer, idx + 1)); ! boolean split = recalculateDataLen() > fileHeader.getWorkSize(); if (split) *************** *** 749,752 **** --- 761,765 ---- setValues(leftVals); setPointers(leftPtrs); + recalculateDataLen(); //cache.add(this); *************** *** 759,770 **** rNode.setValues(rightVals); rNode.setPointers(rightPtrs); cache.add(rNode); parent.setValues(new Value[] { separator }); parent.setPointers(new long[] { page.getPageNum(), rNode.page.getPageNum()}); cache.add(parent); setRootNode(parent); if(rNode.mustSplit()) { ! LOG.debug(getFile().getName() + " right node requires second split: " + rNode.calcDataLen()); rNode.split(); } --- 772,785 ---- rNode.setValues(rightVals); rNode.setPointers(rightPtrs); + rNode.recalculateDataLen(); cache.add(rNode); parent.setValues(new Value[] { separator }); parent.setPointers(new long[] { page.getPageNum(), rNode.page.getPageNum()}); + parent.recalculateDataLen(); cache.add(parent); setRootNode(parent); if(rNode.mustSplit()) { ! LOG.debug(getFile().getName() + " right node requires second split: " + rNode.getDataLen()); rNode.split(); } *************** *** 773,785 **** rNode.setValues(rightVals); rNode.setPointers(rightPtrs); cache.add(rNode); parent.promoteValue(separator, rNode.page.getPageNum()); if(rNode.mustSplit()) { ! LOG.debug(getFile().getName() + " right node requires second split: " + rNode.calcDataLen()); rNode.split(); } } if(mustSplit()) { ! LOG.debug(getFile().getName() + "left node requires second split: " + calcDataLen()); split(); } --- 788,801 ---- rNode.setValues(rightVals); rNode.setPointers(rightPtrs); + rNode.recalculateDataLen(); cache.add(rNode); parent.promoteValue(separator, rNode.page.getPageNum()); if(rNode.mustSplit()) { ! LOG.debug(getFile().getName() + " right node requires second split: " + rNode.getDataLen()); rNode.split(); } } if(mustSplit()) { ! LOG.debug(getFile().getName() + "left node requires second split: " + getDataLen()); split(); } *************** *** 1046,1050 **** setValues(deleteArrayValue(values, leftIdx)); setPointers(deleteArrayLong(ptrs, leftIdx)); ! //cache.add(this); } break; --- 1062,1066 ---- setValues(deleteArrayValue(values, leftIdx)); setPointers(deleteArrayLong(ptrs, leftIdx)); ! recalculateDataLen(); } break; *************** *** 1056,1060 **** setValues(deleteArrayValue(values, i)); setPointers(deleteArrayLong(ptrs, i)); ! //cache.add(this); } break; --- 1072,1076 ---- setValues(deleteArrayValue(values, i)); setPointers(deleteArrayLong(ptrs, i)); ! recalculateDataLen(); } break; *************** *** 1076,1080 **** setPointers(deleteArrayLong(ptrs, i)); --i; ! //cache.add(this); } } --- 1092,1096 ---- setPointers(deleteArrayLong(ptrs, i)); --i; ! recalculateDataLen(); } } *************** *** 1094,1098 **** setPointers(deleteArrayLong(ptrs, i)); --i; ! //cache.add(this); } } --- 1110,1114 ---- setPointers(deleteArrayLong(ptrs, i)); --i; ! recalculateDataLen(); } } *************** *** 1112,1116 **** setPointers(deleteArrayLong(ptrs, i)); --i; ! //cache.add(this); } break; --- 1128,1132 ---- setPointers(deleteArrayLong(ptrs, i)); --i; ! recalculateDataLen(); } break; *************** *** 1127,1131 **** setPointers(deleteArrayLong(ptrs, i)); --i; ! //cache.add(this); } break; --- 1143,1147 ---- setPointers(deleteArrayLong(ptrs, i)); --i; ! recalculateDataLen(); } break; *************** *** 1142,1146 **** setPointers(deleteArrayLong(ptrs, i)); --i; ! //cache.add(this); } else if (query.getOperator() == IndexQuery.TRUNC_RIGHT) break; --- 1158,1162 ---- setPointers(deleteArrayLong(ptrs, i)); --i; ! recalculateDataLen(); } else if (query.getOperator() == IndexQuery.TRUNC_RIGHT) break; *************** *** 1157,1161 **** setPointers(deleteArrayLong(ptrs, i)); --i; ! //cache.add(this); } --- 1173,1177 ---- setPointers(deleteArrayLong(ptrs, i)); --i; ! recalculateDataLen(); } *************** *** 1177,1181 **** setPointers(deleteArrayLong(ptrs, i)); --i; ! //cache.add(this); } break; --- 1193,1197 ---- setPointers(deleteArrayLong(ptrs, i)); --i; ! recalculateDataLen(); } break; *************** *** 1189,1193 **** setPointers(deleteArrayLong(ptrs, i)); --i; ! //cache.add(this); } break; --- 1205,1209 ---- setPointers(deleteArrayLong(ptrs, i)); --i; ! recalculateDataLen(); } break; |
From: Wolfgang M. M. <wol...@us...> - 2004-04-05 11:32:11
|
Update of /cvsroot/exist/eXist-1.0/src/org/dbxml/core/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29682/src/org/dbxml/core/data Modified Files: Value.java Log Message: Avoid recalculation of btree node data size on every update. Instead, use a private field for the size and update it only if required. Index: Value.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/data/Value.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Value.java 20 Feb 2003 09:32:35 -0000 1.4 --- Value.java 5 Apr 2004 11:19:29 -0000 1.5 *************** *** 119,122 **** --- 119,123 ---- public Value trim() { if(pos > 0 || len < data.length) { + System.out.println("trimming value"); final byte[] b = new byte[len]; System.arraycopy(data, pos, b, 0, len); |
From: Jean-Marc V. <jm...@us...> - 2004-04-02 17:39:32
|
Update of /cvsroot/exist/eXist-1.0/webapp/xse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1407 Modified Files: sprocess-foc.xsp Log Message: correct bug in number of hits per page Index: sprocess-foc.xsp =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/xse/sprocess-foc.xsp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sprocess-foc.xsp 8 Mar 2004 18:12:02 -0000 1.6 --- sprocess-foc.xsp 2 Apr 2004 17:27:15 -0000 1.7 *************** *** 29,43 **** <!-- include header --> <ci:include src="foc-header.xml"/> ! <!-- include sidebar --> <ci:include src="foc-sidebar.xml"/> ! <body> <section title="Query results"> ! <xsp:logic> // get start and count parameters String pstart = <xsp-request:get-parameter name="start" as="string"/>; ! String pcount = <xsp-request:get-parameter name="count" as="string"/>; String resultId = <xsp-request:get-parameter name="id" as="string"/>; if(pstart == null) pstart = "1"; --- 29,43 ---- <!-- include header --> <ci:include src="foc-header.xml"/> ! <!-- include sidebar --> <ci:include src="foc-sidebar.xml"/> ! <body> <section title="Query results"> ! <xsp:logic> // get start and count parameters String pstart = <xsp-request:get-parameter name="start" as="string"/>; ! String pcount = <xsp-request:get-parameter name="howmany" as="string"/>; String resultId = <xsp-request:get-parameter name="id" as="string"/>; if(pstart == null) pstart = "1"; *************** *** 46,50 **** int count = Integer.parseInt(pcount); int hits = 0; ! String query = <xsp-request:get-parameter name="query" as="string"/>; String squery = <xsp-request:get-parameter name="squery" as="string"/>; --- 46,50 ---- int count = Integer.parseInt(pcount); int hits = 0; ! String query = <xsp-request:get-parameter name="query" as="string"/>; String squery = <xsp-request:get-parameter name="squery" as="string"/>; *************** *** 52,56 **** String psummarize = <xsp-request:get-parameter name="summarize" as="string"/>; boolean summarize = (psummarize == null) ? false : true; ! // jmv <![CDATA[ StringBuffer comment = new StringBuffer(); --- 52,56 ---- String psummarize = <xsp-request:get-parameter name="summarize" as="string"/>; boolean summarize = (psummarize == null) ? false : true; ! // jmv <![CDATA[ StringBuffer comment = new StringBuffer(); |
From: Jean-Marc V. <jm...@us...> - 2004-04-02 17:38:09
|
Update of /cvsroot/exist/eXist-1.0/webapp/xse/stylesheets/db/foc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1159/stylesheets/db/foc Modified Files: display.xslt Log Message: add indication of Genus/Family Index: display.xslt =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/xse/stylesheets/db/foc/display.xslt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** display.xslt 18 Feb 2004 20:34:37 -0000 1.5 --- display.xslt 2 Apr 2004 17:25:44 -0000 1.6 *************** *** 90,95 **** <xsl:template match="*[local-name()='rank_id']" mode="wwbota-classic" > ! rank_id: <xsl:value-of select='.'/>; </xsl:template> <xsl:template match="*[local-name()='taxon_date']" mode="wwbota-classic" > taxon date: <xsl:value-of select='.'/>; --- 90,100 ---- <xsl:template match="*[local-name()='rank_id']" mode="wwbota-classic" > ! <!-- rank_id: <xsl:value-of select='.'/>; --> ! <xsl:choose> ! <xsl:when test=". = '125' "> <span style="color:brown" class='rank_id' > - Family </span>; </xsl:when> ! <xsl:when test=". = '135' "> <span style="color:brown" class='rank_id' > - Genus </span>; </xsl:when> ! </xsl:choose> </xsl:template> + <xsl:template match="*[local-name()='taxon_date']" mode="wwbota-classic" > taxon date: <xsl:value-of select='.'/>; |
From: Jean-Marc V. <jm...@us...> - 2004-04-01 19:15:37
|
Update of /cvsroot/exist/eXist-1.0/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16909/src Added Files: Doxyfile Log Message: Config. file for source documentation tool http://www.doxygen.org/ --- NEW FILE: Doxyfile --- # Doxyfile 1.3.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. [...1039 lines suppressed...] # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::addtions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:24:44
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/soap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23472/src/org/exist/soap Modified Files: QuerySoapBindingImpl.java Log Message: Security issues fixed: resources were included in the XQuery context though the user had no permission to read the resource. REST-style interface did not correctly check permissions; /db/system/users.xml could be retrieved by ordinary users. Index: QuerySoapBindingImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/soap/QuerySoapBindingImpl.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** QuerySoapBindingImpl.java 25 Mar 2004 12:50:51 -0000 1.19 --- QuerySoapBindingImpl.java 1 Apr 2004 14:12:46 -0000 1.20 *************** *** 215,219 **** int p; String resource; ! for (Iterator i = collection.iterator(); i.hasNext(); j++) { resource = ((DocumentImpl) i.next()).getFileName(); p = resource.lastIndexOf('/'); --- 215,219 ---- int p; String resource; ! for (Iterator i = collection.iterator(broker); i.hasNext(); j++) { resource = ((DocumentImpl) i.next()).getFileName(); p = resource.lastIndexOf('/'); |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:24:44
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23472/src/org/exist/dom Modified Files: DocumentSet.java Log Message: Security issues fixed: resources were included in the XQuery context though the user had no permission to read the resource. REST-style interface did not correctly check permissions; /db/system/users.xml could be retrieved by ordinary users. Index: DocumentSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/DocumentSet.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DocumentSet.java 2 Feb 2004 15:30:39 -0000 1.10 --- DocumentSet.java 1 Apr 2004 14:12:46 -0000 1.11 *************** *** 28,31 **** --- 28,33 ---- import org.apache.log4j.Category; import org.exist.collections.*; + import org.exist.security.Permission; + import org.exist.storage.DBBroker; import org.exist.util.hashtable.Int2ObjectHashMap; import org.w3c.dom.Node; *************** *** 100,108 **** * @param docs */ ! public void addAll(java.util.Collection docs) { DocumentImpl doc; for(Iterator i = docs.iterator(); i.hasNext(); ) { doc = (DocumentImpl)i.next(); ! if(!doc.isLockedForWrite()) put(doc.getDocId(), doc); } --- 102,110 ---- * @param docs */ ! public void addAll(DBBroker broker, java.util.Collection docs) { DocumentImpl doc; for(Iterator i = docs.iterator(); i.hasNext(); ) { doc = (DocumentImpl)i.next(); ! if((broker == null || doc.getPermissions().validate(broker.getUser(), Permission.READ)) && (!doc.isLockedForWrite())) put(doc.getDocId(), doc); } |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:24:44
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/http In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23472/src/org/exist/http Modified Files: RESTServer.java Log Message: Security issues fixed: resources were included in the XQuery context though the user had no permission to read the resource. REST-style interface did not correctly check permissions; /db/system/users.xml could be retrieved by ordinary users. Index: RESTServer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/http/RESTServer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RESTServer.java 2 Mar 2004 08:44:19 -0000 1.6 --- RESTServer.java 1 Apr 2004 14:12:45 -0000 1.7 *************** *** 123,126 **** --- 123,127 ---- public Response doGet(DBBroker broker, Map parameters, String path) throws BadRequestException, PermissionDeniedException, NotFoundException { + LOG.debug("user = " + broker.getUser().getName()); int howmany = 10; int start = 1; *************** *** 172,178 **** if (d == null) { Collection collection = broker.getCollection(path); ! if(collection != null) ! response = new Response(printCollection(broker, collection)); ! else { throw new NotFoundException("Document " + path + " not found"); } --- 173,182 ---- if (d == null) { Collection collection = broker.getCollection(path); ! if(collection != null) { ! if(!collection.getPermissions().validate(broker.getUser(), Permission.READ)) ! throw new PermissionDeniedException("Not allowed to read collection"); ! else ! response = new Response(printCollection(broker, collection)); ! } else { throw new NotFoundException("Document " + path + " not found"); } *************** *** 490,522 **** .getName() + '/' + child); ! attrs.clear(); ! attrs.addAttribute("", "name", "name", "CDATA", child); ! ! attrs.addAttribute("", "created", "created", "CDATA", ! dateFormat.format(new Date(childCollection ! .getCreationTime()))); ! printPermissions(attrs, childCollection.getPermissions()); ! serializer.startElement(NS, "collection", "exist:collection", ! attrs); ! serializer.endElement(NS, "collection", "exist:collection"); } ! for (Iterator i = collection.iterator(); i.hasNext(); ) { DocumentImpl doc = (DocumentImpl) i.next(); ! String resource = doc.getFileName(); ! int p = resource.lastIndexOf('/'); ! attrs.clear(); ! attrs.addAttribute("", "name", "name", "CDATA", p < 0 ! ? resource ! : resource.substring(p + 1)); ! attrs.addAttribute("", "created", "created", "CDATA", ! dateFormat.format(new Date(doc.getCreated()))); ! attrs.addAttribute("", "last-modified", "last-modified", ! "CDATA", dateFormat.format(new Date(doc ! .getLastModified()))); ! printPermissions(attrs, doc.getPermissions()); ! serializer ! .startElement(NS, "resource", "exist:resource", attrs); ! serializer.endElement(NS, "resource", "exist:resource"); } --- 494,530 ---- .getName() + '/' + child); ! if(childCollection.getPermissions().validate(broker.getUser(), Permission.READ)) { ! attrs.clear(); ! attrs.addAttribute("", "name", "name", "CDATA", child); ! ! attrs.addAttribute("", "created", "created", "CDATA", ! dateFormat.format(new Date(childCollection ! .getCreationTime()))); ! printPermissions(attrs, childCollection.getPermissions()); ! serializer.startElement(NS, "collection", "exist:collection", ! attrs); ! serializer.endElement(NS, "collection", "exist:collection"); ! } } ! for (Iterator i = collection.iterator(broker); i.hasNext(); ) { DocumentImpl doc = (DocumentImpl) i.next(); ! if(doc.getPermissions().validate(broker.getUser(), Permission.READ)) { ! String resource = doc.getFileName(); ! int p = resource.lastIndexOf('/'); ! attrs.clear(); ! attrs.addAttribute("", "name", "name", "CDATA", p < 0 ! ? resource ! : resource.substring(p + 1)); ! attrs.addAttribute("", "created", "created", "CDATA", ! dateFormat.format(new Date(doc.getCreated()))); ! attrs.addAttribute("", "last-modified", "last-modified", ! "CDATA", dateFormat.format(new Date(doc ! .getLastModified()))); ! printPermissions(attrs, doc.getPermissions()); ! serializer ! .startElement(NS, "resource", "exist:resource", attrs); ! serializer.endElement(NS, "resource", "exist:resource"); ! } } |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:24:44
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/collections/triggers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23472/src/org/exist/collections/triggers Modified Files: Dumper.java Log Message: Security issues fixed: resources were included in the XQuery context though the user had no permission to read the resource. REST-style interface did not correctly check permissions; /db/system/users.xml could be retrieved by ordinary users. Index: Dumper.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/collections/triggers/Dumper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Dumper.java 2 Oct 2003 12:19:26 -0000 1.2 --- Dumper.java 1 Apr 2004 14:12:45 -0000 1.3 *************** *** 64,68 **** System.out.println("collection contents:"); DocumentSet docs = new DocumentSet(); ! collection.getDocuments(docs); for(int i = 0; i < docs.getLength(); i++) System.out.println("\t" + ((DocumentImpl)docs.item(i)).getFileName()); --- 64,68 ---- System.out.println("collection contents:"); DocumentSet docs = new DocumentSet(); ! collection.getDocuments(broker, docs); for(int i = 0; i < docs.getLength(); i++) System.out.println("\t" + ((DocumentImpl)docs.item(i)).getFileName()); |