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
(86) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7994/src/org/exist/storage Modified Files: NativeTextEngine.java TextSearchEngine.java DBBroker.java BrokerPool.java NativeBroker.java Added Files: XQueryPool.java Removed Files: ElementPool.java Log Message: Moved the caching infrastructure for XQueries from the interfaces to the database core. Index: TextSearchEngine.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/TextSearchEngine.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TextSearchEngine.java 25 Mar 2004 12:50:50 -0000 1.8 --- TextSearchEngine.java 17 May 2004 09:54:41 -0000 1.9 *************** *** 43,46 **** --- 43,48 ---- import org.exist.util.Occurrences; import org.exist.util.PorterStemmer; + import org.exist.xquery.TerminatedException; + import org.exist.xquery.XQueryContext; /** *************** *** 160,165 **** * @return */ ! public NodeSet getNodesContaining(DocumentSet doc, NodeSet context, String expr) { ! return getNodesContaining(doc, context, expr, DBBroker.MATCH_EXACT); } --- 162,168 ---- * @return */ ! public NodeSet getNodesContaining(XQueryContext context, DocumentSet docs, NodeSet contextSet, ! String expr) throws TerminatedException { ! return getNodesContaining(context, docs, contextSet, expr, DBBroker.MATCH_EXACT); } *************** *** 176,183 **** * @return */ ! public abstract NodeSet getNodesContaining(DocumentSet docs, NodeSet context, String expr, int type); ! public abstract NodeSet getNodes(DocumentSet docs, NodeSet context, TermMatcher matcher, ! CharSequence startTerm); /** --- 179,187 ---- * @return */ ! public abstract NodeSet getNodesContaining(XQueryContext context, DocumentSet docs, ! NodeSet contextSet, String expr, int type) throws TerminatedException; ! public abstract NodeSet getNodes(XQueryContext context, DocumentSet docs, NodeSet contextSet, ! TermMatcher matcher, CharSequence startTerm) throws TerminatedException; /** Index: DBBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/DBBroker.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** DBBroker.java 10 May 2004 11:22:41 -0000 1.26 --- DBBroker.java 17 May 2004 09:54:41 -0000 1.27 *************** *** 51,54 **** --- 51,55 ---- import org.exist.util.Occurrences; import org.exist.xquery.NodeSelector; + import org.exist.xquery.XQuery; import org.w3c.dom.Document; import org.w3c.dom.Node; *************** *** 87,90 **** --- 88,93 ---- protected User user = null; + protected XQuery xqueryService; + private int referenceCount = 0; *************** *** 155,158 **** --- 158,162 ---- xupdateGrowthFactor = 1; this.pool = pool; + xqueryService = new XQuery(this); } *************** *** 165,168 **** --- 169,176 ---- } + public XQuery getXQueryService() { + return xqueryService; + } + /** * find elements by their tag name. This method is comparable to the DOM's --- ElementPool.java DELETED --- Index: NativeBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeBroker.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** NativeBroker.java 10 May 2004 11:22:41 -0000 1.66 --- NativeBroker.java 17 May 2004 09:54:41 -0000 1.67 *************** *** 87,90 **** --- 87,91 ---- import org.exist.xquery.Constants; import org.exist.xquery.NodeSelector; + import org.exist.xquery.TerminatedException; import org.exist.xquery.XQueryContext; import org.w3c.dom.Document; *************** *** 375,379 **** } catch (LockException e) { LOG.warn("failed to acquire lock", e); ! } finally { lock.release(); } --- 376,382 ---- } catch (LockException e) { LOG.warn("failed to acquire lock", e); ! } catch (TerminatedException e) { ! LOG.warn("Method terminated", e); ! } finally { lock.release(); } *************** *** 1498,1502 **** } catch (IOException e) { LOG.warn("io error while removing document", e); ! } return null; } --- 1501,1507 ---- } catch (IOException e) { LOG.warn("io error while removing document", e); ! } catch (TerminatedException e) { ! LOG.warn("method terminated", e); ! } return null; } *************** *** 1611,1615 **** LOG.warn("removeDocument(String) - " + "could not acquire lock on elements", e); ! } finally { lock.release(); } --- 1616,1622 ---- LOG.warn("removeDocument(String) - " + "could not acquire lock on elements", e); ! } catch (TerminatedException e) { ! LOG.warn("method terminated", e); ! } finally { lock.release(); } *************** *** 1654,1658 **** } catch (IOException e) { LOG.warn("start() - " + "error while removing doc", e); ! } return null; } --- 1661,1667 ---- } catch (IOException e) { LOG.warn("start() - " + "error while removing doc", e); ! } catch (TerminatedException e) { ! LOG.warn("method terminated", e); ! } return null; } --- NEW FILE: XQueryPool.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist-db.org * * 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: XQueryPool.java,v 1.1 2004/05/17 09:54:41 wolfgang_m Exp $ */ package org.exist.storage; import java.util.Iterator; import java.util.Stack; import org.apache.log4j.Logger; import org.exist.source.Source; import org.exist.util.hashtable.Object2ObjectHashMap; import org.exist.xquery.CompiledXQuery; /** * @author wolf */ public class XQueryPool extends Object2ObjectHashMap { private final static int MAX_STACK_SIZE = 5; private final static long TIMEOUT = 120000; private final static long TIMEOUT_CHECK_INTERVAL = 30000; private final static Logger LOG = Logger.getLogger(XQueryPool.class); private long lastTimeOutCheck; /** * */ protected XQueryPool() { super(27); lastTimeOutCheck = System.currentTimeMillis(); } public synchronized void returnCompiledXQuery(Source source, CompiledXQuery xquery) { Stack stack = (Stack)get(source); if(stack == null) { stack = new Stack(); source.setCacheTimestamp(System.currentTimeMillis()); put(source, stack); } if(stack.size() < MAX_STACK_SIZE) { stack.push(xquery); } timeoutCheck(); } public synchronized CompiledXQuery borrowCompiledXQuery(Source source) { int idx = getIndex(source); if(idx < 0) return null; Source key = (Source)keys[idx]; int validity = key.isValid(); if(validity == Source.UNKNOWN) validity = key.isValid(source); if(validity == Source.INVALID || validity == Source.UNKNOWN) { keys[idx] = REMOVED; values[idx] = null; LOG.debug(source.getKey() + " is invalid"); return null; } Stack stack = (Stack)values[idx]; if(stack != null && !stack.isEmpty()) { return (CompiledXQuery)stack.pop(); } return null; } private void timeoutCheck() { final long currentTime = System.currentTimeMillis(); if(currentTime - lastTimeOutCheck < TIMEOUT_CHECK_INTERVAL) return; for(Iterator i = iterator(); i.hasNext(); ) { Source next = (Source)i.next(); if(currentTime - next.getCacheTimestamp() > TIMEOUT) remove(next); } } } Index: NativeTextEngine.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeTextEngine.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** NativeTextEngine.java 3 May 2004 13:08:43 -0000 1.45 --- NativeTextEngine.java 17 May 2004 09:54:41 -0000 1.46 *************** *** 81,84 **** --- 81,86 ---- import org.exist.util.ReadOnlyException; import org.exist.util.UTF8; + import org.exist.xquery.TerminatedException; + import org.exist.xquery.XQueryContext; import org.w3c.dom.Node; import org.w3c.dom.NodeList; *************** *** 264,269 **** } ! public NodeSet getNodesContaining(DocumentSet docs, NodeSet context, ! String expr, int type) { if (type == DBBroker.MATCH_EXACT && containsWildcards(expr)) { type = DBBroker.MATCH_WILDCARDS; --- 266,271 ---- } ! public NodeSet getNodesContaining(XQueryContext context, DocumentSet docs, NodeSet contextSet, ! String expr, int type) throws TerminatedException { if (type == DBBroker.MATCH_EXACT && containsWildcards(expr)) { type = DBBroker.MATCH_WILDCARDS; *************** *** 271,277 **** switch (type) { case DBBroker.MATCH_EXACT : ! return getNodesExact(docs, context, expr); default : ! return getNodesRegexp(docs, context, expr, type); } } --- 273,279 ---- switch (type) { case DBBroker.MATCH_EXACT : ! return getNodesExact(context, docs, contextSet, expr); default : ! return getNodesRegexp(context, docs, contextSet, expr, type); } } *************** *** 287,296 **** * @return array containing a NodeSet for each of the search terms */ ! public NodeSet getNodesExact(DocumentSet docs, NodeSet context, String expr) { if (expr == null) return null; if (stoplist.contains(expr)) return null; ! long start = System.currentTimeMillis(); DocumentImpl doc; Value ref; --- 289,299 ---- * @return array containing a NodeSet for each of the search terms */ ! public NodeSet getNodesExact(XQueryContext context, DocumentSet docs, NodeSet contextSet, String expr) ! throws TerminatedException { if (expr == null) return null; if (stoplist.contains(expr)) return null; ! // long start = System.currentTimeMillis(); DocumentImpl doc; Value ref; *************** *** 308,312 **** NodeProxy parent, current = new NodeProxy(); NodeSet result; ! if (context == null) result = new TextSearchResult(trackMatches != Serializer.TAG_NONE); else --- 311,315 ---- NodeProxy parent, current = new NodeProxy(); NodeSet result; ! if (contextSet == null) result = new TextSearchResult(trackMatches != Serializer.TAG_NONE); else *************** *** 331,340 **** len = is.readInt(); if ((doc = docs.getDoc(docId)) == null ! || (context != null && !context.containsDoc(doc))) { is.skip(len); continue; } ! if (context != null) ! sizeHint = context.getSizeHint(doc); last = 0; for (int j = 0; j < len; j++) { --- 334,343 ---- len = is.readInt(); if ((doc = docs.getDoc(docId)) == null ! || (contextSet != null && !contextSet.containsDoc(doc))) { is.skip(len); continue; } ! if (contextSet != null) ! sizeHint = contextSet.getSizeHint(doc); last = 0; for (int j = 0; j < len; j++) { *************** *** 343,351 **** last = gid; count++; ! if (context != null) { current = (section == TEXT_SECTION ? new NodeProxy( doc, gid, Node.TEXT_NODE) : new NodeProxy( doc, gid, Node.ATTRIBUTE_NODE)); ! parent = context.parentWithChild(current, false, true, -1); if (parent != null) { --- 346,354 ---- last = gid; count++; ! if (contextSet != null) { current = (section == TEXT_SECTION ? new NodeProxy( doc, gid, Node.TEXT_NODE) : new NodeProxy( doc, gid, Node.ATTRIBUTE_NODE)); ! parent = contextSet.parentWithChild(current, false, true, -1); if (parent != null) { *************** *** 356,359 **** --- 359,363 ---- } else ((TextSearchResult) result).add(doc, gid, term); + context.proceed(); } } *************** *** 367,388 **** } } ! if (context != null) ((ExtArrayNodeSet) result).sort(); ! LOG.debug( ! "found " ! + expr ! + ": " ! + result.getLength() ! + " (" ! + count ! + ") " ! + " in " ! + (System.currentTimeMillis() - start) ! + "ms."); return result; } ! private NodeSet getNodesRegexp(DocumentSet docs, NodeSet context, ! String expr, int type) { if (expr == null) return null; --- 371,392 ---- } } ! if (contextSet != null) ((ExtArrayNodeSet) result).sort(); ! // LOG.debug( ! // "found " ! // + expr ! // + ": " ! // + result.getLength() ! // + " (" ! // + count ! // + ") " ! // + " in " ! // + (System.currentTimeMillis() - start) ! // + "ms."); return result; } ! private NodeSet getNodesRegexp(XQueryContext context, DocumentSet docs, NodeSet contextSet, ! String expr, int type) throws TerminatedException { if (expr == null) return null; *************** *** 398,402 **** try { TermMatcher comparator = new RegexMatcher(expr, type); ! return getNodes(docs, context, comparator, term); } catch (EXistException e) { return null; --- 402,406 ---- try { TermMatcher comparator = new RegexMatcher(expr, type); ! return getNodes(context, docs, contextSet, comparator, term); } catch (EXistException e) { return null; *************** *** 415,423 **** * @return array containing a NodeSet for each of the search terms */ ! public NodeSet getNodes(DocumentSet docs, NodeSet context, ! TermMatcher matcher, CharSequence startTerm) { ! long start = System.currentTimeMillis(); NodeSet result; ! if (context == null) result = new TextSearchResult(trackMatches != Serializer.TAG_NONE); else --- 419,427 ---- * @return array containing a NodeSet for each of the search terms */ ! public NodeSet getNodes(XQueryContext context, DocumentSet docs, NodeSet contextSet, ! TermMatcher matcher, CharSequence startTerm) throws TerminatedException { ! // long start = System.currentTimeMillis(); NodeSet result; ! if (contextSet == null) result = new TextSearchResult(trackMatches != Serializer.TAG_NONE); else *************** *** 428,432 **** SearchCallback cb; Lock lock = dbWords.getLock(); ! cb = new SearchCallback(matcher, result, context, docs); for (Iterator iter = docs.getCollectionIterator(); iter.hasNext();) { collection = (Collection) iter.next(); --- 432,436 ---- SearchCallback cb; Lock lock = dbWords.getLock(); ! cb = new SearchCallback(context, matcher, result, contextSet, docs); for (Iterator iter = docs.getCollectionIterator(); iter.hasNext();) { collection = (Collection) iter.next(); *************** *** 452,457 **** } } ! LOG.debug("regexp found: " + result.getLength() + " in " ! + (System.currentTimeMillis() - start) + "ms."); return result; } --- 456,461 ---- } } ! // LOG.debug("regexp found: " + result.getLength() + " in " ! // + (System.currentTimeMillis() - start) + "ms."); return result; } *************** *** 463,467 **** short collectionId; Lock lock = dbWords.getLock(); ! IndexCallback cb = new IndexCallback(matcher); for (Iterator iter = docs.getCollectionIterator(); iter.hasNext();) { collection = (Collection) iter.next(); --- 467,471 ---- short collectionId; Lock lock = dbWords.getLock(); ! IndexCallback cb = new IndexCallback(null, matcher); for (Iterator iter = docs.getCollectionIterator(); iter.hasNext();) { collection = (Collection) iter.next(); *************** *** 477,481 **** } catch (BTreeException bte) { LOG.debug(bte); ! } } catch (LockException e) { LOG.debug(e); --- 481,487 ---- } catch (BTreeException bte) { LOG.debug(bte); ! } catch (TerminatedException e) { ! LOG.debug(e); ! } } catch (LockException e) { LOG.debug(e); *************** *** 545,549 **** } catch (BTreeException e) { LOG.warn("error while reading words", e); ! } finally { lock.release(); } --- 551,557 ---- } catch (BTreeException e) { LOG.warn("error while reading words", e); ! } catch (TerminatedException e) { ! LOG.warn("Method terminated", e); ! } finally { lock.release(); } *************** *** 756,759 **** --- 764,768 ---- } } + private final static class WordRef extends Value { *************** *** 1131,1137 **** List matches = new ArrayList(); TermMatcher matcher; ! public IndexCallback(TermMatcher matcher) { this.matcher = matcher; } --- 1140,1148 ---- List matches = new ArrayList(); TermMatcher matcher; + XQueryContext context; ! public IndexCallback(XQueryContext context, TermMatcher matcher) { this.matcher = matcher; + this.context = context; } *************** *** 1144,1148 **** * @see org.dbxml.core.filer.BTreeCallback#indexInfo(org.dbxml.core.data.Value, long) */ ! public boolean indexInfo(Value key, long pointer) { String word; try { --- 1155,1161 ---- * @see org.dbxml.core.filer.BTreeCallback#indexInfo(org.dbxml.core.data.Value, long) */ ! public boolean indexInfo(Value key, long pointer) throws TerminatedException { ! if(context != null) ! context.proceed(); String word; try { *************** *** 1162,1176 **** DocumentSet docs; TermMatcher matcher; ! NodeSet result, context; ! ! public SearchCallback(TermMatcher comparator, NodeSet result, ! NodeSet context, DocumentSet docs) { this.matcher = comparator; this.result = result; this.docs = docs; this.context = context; } ! public boolean indexInfo(Value key, long pointer) { String word; try { --- 1175,1191 ---- DocumentSet docs; TermMatcher matcher; ! NodeSet result, contextSet; ! XQueryContext context; ! ! public SearchCallback(XQueryContext context, TermMatcher comparator, NodeSet result, ! NodeSet contextSet, DocumentSet docs) { this.matcher = comparator; this.result = result; this.docs = docs; + this.contextSet = contextSet; this.context = context; } ! public boolean indexInfo(Value key, long pointer) throws TerminatedException { String word; try { *************** *** 1201,1204 **** --- 1216,1221 ---- try { while (is.available() > 0) { + if(context != null) + context.proceed(); docId = is.readInt(); section = is.readByte(); *************** *** 1208,1213 **** continue; } ! if (context != null) ! sizeHint = context.getSizeHint(doc); last = -1; for (int j = 0; j < len; j++) { --- 1225,1230 ---- continue; } ! if (contextSet != null) ! sizeHint = contextSet.getSizeHint(doc); last = -1; for (int j = 0; j < len; j++) { *************** *** 1215,1219 **** gid = (last < 0 ? delta : last + delta); last = gid; ! if (context != null) { proxy = (section == TEXT_SECTION ? new NodeProxy(doc, gid, --- 1232,1236 ---- gid = (last < 0 ? delta : last + delta); last = gid; ! if (contextSet != null) { proxy = (section == TEXT_SECTION ? new NodeProxy(doc, gid, *************** *** 1221,1225 **** : new NodeProxy(doc, gid, Node.ATTRIBUTE_NODE)); ! parent = context.parentWithChild(proxy, false, true, -1); if (parent != null) { --- 1238,1242 ---- : new NodeProxy(doc, gid, Node.ATTRIBUTE_NODE)); ! parent = contextSet.parentWithChild(proxy, false, true, -1); if (parent != null) { *************** *** 1238,1242 **** } } ! if (context != null) ((ExtArrayNodeSet) result).sort(); return true; --- 1255,1259 ---- } } ! if (contextSet != null) ((ExtArrayNodeSet) result).sort(); return true; Index: BrokerPool.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/BrokerPool.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** BrokerPool.java 23 Apr 2004 13:07:44 -0000 1.20 --- BrokerPool.java 17 May 2004 09:54:41 -0000 1.21 *************** *** 168,171 **** --- 168,172 ---- private SyncDaemon syncDaemon; private ShutdownListener shutdownListener = null; + private XQueryPool xqueryCache; /** *************** *** 194,197 **** --- 195,199 ---- syncDaemon.executePeriodically(syncPeriod, new Sync(this), false); conf = config; + xqueryCache = new XQueryPool(); initialize(); } *************** *** 236,265 **** *@exception EXistException Description of the Exception */ ! public synchronized DBBroker get() throws EXistException { if (!isInstanceConfigured()) throw new EXistException("database instance is not available"); DBBroker broker = (DBBroker)threads.get(Thread.currentThread()); if(broker != null) { ! // the thread already holds a reference to a broker object. broker.incReferenceCount(); return broker; } ! if (pool.isEmpty()) { ! if (brokers < max) ! createBroker(); ! else ! while (pool.isEmpty()) { ! LOG.debug("waiting for broker instance to become available"); ! try { ! this.wait(); ! } catch (InterruptedException e) { } ! } } - broker = (DBBroker) pool.pop(); - threads.put(Thread.currentThread(), broker); - broker.incReferenceCount(); - this.notifyAll(); - return broker; } --- 238,269 ---- *@exception EXistException Description of the Exception */ ! public DBBroker get() throws EXistException { if (!isInstanceConfigured()) throw new EXistException("database instance is not available"); DBBroker broker = (DBBroker)threads.get(Thread.currentThread()); if(broker != null) { ! // the thread already holds a reference to a broker object broker.incReferenceCount(); return broker; } ! synchronized(this) { ! if (pool.isEmpty()) { ! if (brokers < max) ! createBroker(); ! else ! while (pool.isEmpty()) { ! LOG.debug("waiting for broker instance to become available"); ! try { ! this.wait(); ! } catch (InterruptedException e) { ! } } ! } ! broker = (DBBroker) pool.pop(); ! threads.put(Thread.currentThread(), broker); ! broker.incReferenceCount(); ! this.notifyAll(); ! return broker; } } *************** *** 271,275 **** * @throws EXistException */ ! public synchronized DBBroker get(User user) throws EXistException { DBBroker broker = get(); broker.setUser(user); --- 275,279 ---- * @throws EXistException */ ! public DBBroker get(User user) throws EXistException { DBBroker broker = get(); broker.setUser(user); *************** *** 328,336 **** return; } - threads.remove(Thread.currentThread()); - if (pool.contains(broker)) { - return; - } synchronized (this) { pool.push(broker); if (syncRequired && pool.size() == brokers) { --- 332,337 ---- return; } synchronized (this) { + threads.remove(Thread.currentThread()); pool.push(broker); if (syncRequired && pool.size() == brokers) { *************** *** 417,420 **** --- 418,425 ---- } + public XQueryPool getXQueryPool() { + return xqueryCache; + } + protected static class ShutdownThread extends Thread { |
From: Wolfgang M. M. <wol...@us...> - 2004-05-17 09:54:51
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/store In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7994/src/org/exist/storage/store Modified Files: DOMFile.java BFile.java Log Message: Moved the caching infrastructure for XQueries from the interfaces to the database core. Index: DOMFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/DOMFile.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** DOMFile.java 10 May 2004 11:22:42 -0000 1.25 --- DOMFile.java 17 May 2004 09:54:41 -0000 1.26 *************** *** 53,56 **** --- 53,57 ---- import org.exist.util.ReentrantReadWriteLock; import org.exist.util.hashtable.Object2LongIdentityHashMap; + import org.exist.xquery.TerminatedException; import org.w3c.dom.Node; *************** *** 667,671 **** BTreeException { final FindCallback cb = new FindCallback(FindCallback.KEYS); ! query(query, cb); return cb.getValues(); } --- 668,677 ---- BTreeException { final FindCallback cb = new FindCallback(FindCallback.KEYS); ! try { ! query(query, cb); ! } catch (TerminatedException e) { ! // Should never happen hear ! LOG.warn("Method terminated"); ! } return cb.getValues(); } *************** *** 758,762 **** BTreeException { FindCallback cb = new FindCallback(FindCallback.VALUES); ! query(query, cb); return cb.getValues(); } --- 764,773 ---- BTreeException { FindCallback cb = new FindCallback(FindCallback.VALUES); ! try { ! query(query, cb); ! } catch (TerminatedException e) { ! // Should never happen ! LOG.warn("Method terminated"); ! } return cb.getValues(); } *************** *** 1814,1818 **** } ! public boolean indexInfo(Value value, long pointer) { switch (mode) { case VALUES: --- 1825,1830 ---- } ! public boolean indexInfo(Value value, long pointer) ! { switch (mode) { case VALUES: *************** *** 1844,1848 **** } ! public boolean indexInfo(Value value, long pointer) { RecordPos rec = findRecord(pointer); short l = ByteConversion.byteToShort(rec.page.data, rec.offset); --- 1856,1861 ---- } ! public boolean indexInfo(Value value, long pointer) ! throws TerminatedException { RecordPos rec = findRecord(pointer); short l = ByteConversion.byteToShort(rec.page.data, rec.offset); Index: BFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/BFile.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** BFile.java 10 May 2004 11:22:41 -0000 1.21 --- BFile.java 17 May 2004 09:54:41 -0000 1.22 *************** *** 21,24 **** --- 21,26 ---- package org.exist.storage.store; + import org.apache.log4j.Logger; + import java.io.ByteArrayOutputStream; import java.io.EOFException; *************** *** 52,55 **** --- 54,58 ---- import org.exist.util.ReadOnlyException; import org.exist.util.ReentrantReadWriteLock; + import org.exist.xquery.TerminatedException; /** *************** *** 70,73 **** --- 73,80 ---- */ public class BFile extends BTree { + /** + * Log4J Logger for this class + */ + private static final Logger LOG = Logger.getLogger(BFile.class); public final static short FILE_FORMAT_VERSION_ID = 3; *************** *** 270,279 **** } - public void filter(IndexQuery query, BFileCallback callback) - throws IOException, BTreeException { - FilterCallback cb = new FilterCallback(callback); - query(query, cb); - } - /** * Remove all entries matching the given query. --- 277,280 ---- *************** *** 284,303 **** */ public void removeAll(IndexQuery query) throws IOException, BTreeException { ! remove(query, new BTreeCallback() { ! public boolean indexInfo(Value value, long pointer) { ! try { ! remove(pointer); ! return true; ! } catch (ReadOnlyException e) { ! LOG.debug("file is read-only"); ! return false; } } ! }); } public ArrayList findEntries(IndexQuery query) throws IOException, ! BTreeException { FindCallback cb = new FindCallback(FindCallback.BOTH); query(query, cb); --- 285,312 ---- */ public void removeAll(IndexQuery query) throws IOException, BTreeException { ! try { ! remove(query, new BTreeCallback() { ! public boolean indexInfo(Value value, long pointer) throws TerminatedException { ! try { ! remove(pointer); ! return true; ! } catch (ReadOnlyException e) { ! LOG.debug("file is read-only"); ! return false; ! } } + }); + } catch (TerminatedException e) { + // Should never happen during remove + + if (LOG.isDebugEnabled()) { + LOG.debug("removeAll() - method has been terminated."); } ! } } public ArrayList findEntries(IndexQuery query) throws IOException, ! BTreeException, TerminatedException { FindCallback cb = new FindCallback(FindCallback.BOTH); query(query, cb); *************** *** 306,310 **** public ArrayList findKeys(IndexQuery query) throws IOException, ! BTreeException { FindCallback cb = new FindCallback(FindCallback.KEYS); query(query, cb); --- 315,319 ---- public ArrayList findKeys(IndexQuery query) throws IOException, ! BTreeException, TerminatedException { FindCallback cb = new FindCallback(FindCallback.KEYS); query(query, cb); *************** *** 313,317 **** public void find(IndexQuery query, IndexCallback callback) ! throws IOException, BTreeException { FindCallback cb = new FindCallback(callback); query(query, cb); --- 322,327 ---- public void find(IndexQuery query, IndexCallback callback) ! throws IOException, BTreeException, ! TerminatedException { FindCallback cb = new FindCallback(callback); query(query, cb); *************** *** 332,342 **** } - public ArrayList findValues(IndexQuery query) throws IOException, - BTreeException { - FindCallback cb = new FindCallback(FindCallback.VALUES); - query(query, cb); - return cb.getValues(); - } - public boolean flush() throws DBException { dataCache.flush(); --- 342,345 ---- *************** *** 510,514 **** } ! public ArrayList getEntries() throws IOException, BTreeException { IndexQuery query = new IndexQuery(IndexQuery.ANY, ""); FindCallback cb = new FindCallback(FindCallback.BOTH); --- 513,518 ---- } ! public ArrayList getEntries() throws IOException, BTreeException, ! TerminatedException { IndexQuery query = new IndexQuery(IndexQuery.ANY, ""); FindCallback cb = new FindCallback(FindCallback.BOTH); *************** *** 517,521 **** } ! public ArrayList getKeys() throws IOException, BTreeException { IndexQuery query = new IndexQuery(IndexQuery.ANY, ""); FindCallback cb = new FindCallback(FindCallback.KEYS); --- 521,526 ---- } ! public ArrayList getKeys() throws IOException, BTreeException, ! TerminatedException { IndexQuery query = new IndexQuery(IndexQuery.ANY, ""); FindCallback cb = new FindCallback(FindCallback.KEYS); *************** *** 524,528 **** } ! public ArrayList getValues() throws IOException, BTreeException { IndexQuery query = new IndexQuery(IndexQuery.ANY, ""); FindCallback cb = new FindCallback(FindCallback.VALUES); --- 529,534 ---- } ! public ArrayList getValues() ! throws IOException, BTreeException, TerminatedException { IndexQuery query = new IndexQuery(IndexQuery.ANY, ""); FindCallback cb = new FindCallback(FindCallback.VALUES); *************** *** 858,861 **** --- 864,871 ---- private final static class FreeSpace implements Comparable { + /** + * Log4J Logger for this class + */ + private static final Logger LOG = Logger.getLogger(FreeSpace.class); private int free = 0; *************** *** 1225,1229 **** } ! public boolean indexInfo(Value value, long pointer) { try { long pos; --- 1235,1239 ---- } ! public boolean indexInfo(Value value, long pointer) throws TerminatedException{ try { long pos; *************** *** 1277,1281 **** } ! public boolean indexInfo(Value value, long pointer) { long pos; short tid; --- 1287,1291 ---- } ! public boolean indexInfo(Value value, long pointer) throws TerminatedException { long pos; short tid; *************** *** 1336,1340 **** private final class OverflowPage extends DataPage { ! byte[] data = null; --- 1346,1350 ---- private final class OverflowPage extends DataPage { ! byte[] data = null; *************** *** 1571,1575 **** public interface PageInputStream { - public long getAddress(); } --- 1581,1584 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-05-17 09:52:11
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7468/src/org/exist/xquery/functions/util Modified Files: ModuleImpl.java EvalFunction.java Added Files: CatchFunction.java Log Message: Added util:catch function to catch Java exceptions in XQuery. --- NEW FILE: CatchFunction.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist-db.org * * 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: CatchFunction.java,v 1.1 2004/05/17 09:52:00 wolfgang_m Exp $ */ package org.exist.xquery.functions.util; import org.exist.dom.QName; import org.exist.xquery.Cardinality; import org.exist.xquery.Function; import org.exist.xquery.FunctionSignature; import org.exist.xquery.XPathException; import org.exist.xquery.XQueryContext; import org.exist.xquery.value.Item; import org.exist.xquery.value.Sequence; import org.exist.xquery.value.SequenceIterator; import org.exist.xquery.value.SequenceType; import org.exist.xquery.value.StringValue; import org.exist.xquery.value.Type; /** * @author wolf */ public class CatchFunction extends Function { public final static FunctionSignature signature = new FunctionSignature( new QName("catch", ModuleImpl.NAMESPACE_URI, ModuleImpl.PREFIX), "Catches the specified exceptions.", new SequenceType[] { new SequenceType(Type.STRING, Cardinality.ONE_OR_MORE), new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE), new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE) }, new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)); /** * @param context * @param signature */ public CatchFunction(XQueryContext context) { super(context, signature); } /* (non-Javadoc) * @see org.exist.xquery.Function#eval(org.exist.xquery.value.Sequence, org.exist.xquery.value.Item) */ public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException { Sequence exceptionClasses = getArgument(0).eval(contextSequence, contextItem); try { context.pushDocumentContext(); try { Sequence result = getArgument(1).eval(contextSequence, contextItem); return result; } finally { context.popDocumentContext(); } } catch(Exception e) { context.popDocumentContext(); context.getWatchDog().reset(); for(SequenceIterator i = exceptionClasses.iterate(); i.hasNext(); ) { Item next = i.nextItem(); try { Class exClass = Class.forName(next.getStringValue()); if(exClass.getName().equals(e.getClass().getName()) || exClass.isInstance(e)) { LOG.debug("Calling exception handler to process " + e.getClass().getName()); ModuleImpl myModule = (ModuleImpl) context.getModule(ModuleImpl.NAMESPACE_URI); QName exQname = new QName("exception", ModuleImpl.NAMESPACE_URI, ModuleImpl.PREFIX); myModule.declareVariable(exQname, new StringValue(e.getClass().getName())); return getArgument(2).eval(contextSequence, contextItem); } } catch (ClassNotFoundException e1) { LOG.warn(e1.getMessage(), e1); } catch (XPathException e2) { LOG.warn(e2); } } // this type of exception is not caught: throw again if(e instanceof XPathException) throw (XPathException)e; throw new XPathException(e); } } /* (non-Javadoc) * @see org.exist.xquery.Function#returnsType() */ public int returnsType() { return getArgument(1).returnsType(); } /* (non-Javadoc) * @see org.exist.xquery.Function#getCardinality() */ public int getCardinality() { return getArgument(1).getCardinality(); } } Index: EvalFunction.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/util/EvalFunction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EvalFunction.java 25 Feb 2004 15:31:58 -0000 1.2 --- EvalFunction.java 17 May 2004 09:52:00 -0000 1.3 *************** *** 103,107 **** XQueryTreeParser astParser = new XQueryTreeParser(context); try { ! parser.xpath(); if(parser.foundErrors()) { LOG.debug(parser.getErrorMessage()); --- 103,107 ---- XQueryTreeParser astParser = new XQueryTreeParser(context); try { ! parser.xpath(); if(parser.foundErrors()) { LOG.debug(parser.getErrorMessage()); *************** *** 111,123 **** AST ast = parser.getAST(); ! PathExpr path = new PathExpr(context); ! astParser.xpath(ast, path); ! if(astParser.foundErrors()) { ! throw new XPathException("error found while executing expression: " + ! astParser.getErrorMessage(), astParser.getLastException()); ! } ! Sequence sequence = path.eval(null, null); ! LOG.debug("found " + sequence.getLength()); ! return sequence; } catch (RecognitionException e) { throw new XPathException("error found while executing expression: " + --- 111,124 ---- AST ast = parser.getAST(); ! PathExpr path = new PathExpr(context); ! astParser.xpath(ast, path); ! if(astParser.foundErrors()) { ! throw new XPathException("error found while executing expression: " + ! astParser.getErrorMessage(), astParser.getLastException()); ! } ! Sequence sequence = path.eval(null, null); ! path.reset(); ! LOG.debug("found " + sequence.getLength() + " for " + expr); ! return sequence; } catch (RecognitionException e) { throw new XPathException("error found while executing expression: " + *************** *** 126,132 **** throw new XPathException("error found while executing expression: " + e.getMessage(), e); - } catch (XPathException e) { - throw new XPathException("error found while executing expression: " + - e.getMessage(), e); } finally { if(oldDocumentSet != null) --- 127,130 ---- Index: ModuleImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/util/ModuleImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ModuleImpl.java 18 Feb 2004 10:15:24 -0000 1.4 --- ModuleImpl.java 17 May 2004 09:52:00 -0000 1.5 *************** *** 43,47 **** new FunctionDef(DocumentId.signature, DocumentId.class), new FunctionDef(CollectionName.signature, CollectionName.class), ! new FunctionDef(LogFunction.signature, LogFunction.class) }; --- 43,48 ---- new FunctionDef(DocumentId.signature, DocumentId.class), new FunctionDef(CollectionName.signature, CollectionName.class), ! new FunctionDef(LogFunction.signature, LogFunction.class), ! new FunctionDef(CatchFunction.signature, CatchFunction.class) }; |
From: Wolfgang M. M. <wol...@us...> - 2004-05-17 09:50:43
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7222/src/org/exist/source Added Files: Source.java CocoonSource.java StringSource.java AbstractSource.java FileSource.java Log Message: New package org.exist.source. Interface Source is used as a wrapper around different sources for XQueries, e.g. file, cocoon source, string ... --- NEW FILE: Source.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist-db.org * * 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: Source.java,v 1.1 2004/05/17 09:50:29 wolfgang_m Exp $ */ package org.exist.source; import java.io.IOException; import java.io.Reader; /** * @author wolf */ public interface Source { public final static int VALID = 1; public final static int INVALID = -1; public final static int UNKNOWN = 0; public Object getKey(); public int isValid(); public int isValid(Source other); public Reader getReader() throws IOException; public String getContent() throws IOException; public void setCacheTimestamp(long timestamp); public long getCacheTimestamp(); } --- NEW FILE: FileSource.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist-db.org * * 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: FileSource.java,v 1.1 2004/05/17 09:50:29 wolfgang_m Exp $ */ package org.exist.source; import java.io.File; import java.io.FileInputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; /** * @author wolf */ public class FileSource extends AbstractSource { private String filePath; private long lastModified; private String encoding; public FileSource(File file, String encoding) { this.filePath = file.getAbsolutePath(); this.lastModified = file.lastModified(); this.encoding = encoding; } /* (non-Javadoc) * @see org.exist.source.Source#getKey() */ public Object getKey() { return filePath; } /* (non-Javadoc) * @see org.exist.source.Source#isValid() */ public int isValid() { File f = new File(filePath); if(f.lastModified() > lastModified) return INVALID; else return VALID; } /* (non-Javadoc) * @see org.exist.source.Source#isValid(org.exist.source.Source) */ public int isValid(Source other) { return INVALID; } /* (non-Javadoc) * @see org.exist.source.Source#getReader() */ public Reader getReader() throws IOException { return new FileReader(new File(filePath)); } /* (non-Javadoc) * @see org.exist.source.Source#getContent() */ public String getContent() throws IOException { FileInputStream is = new FileInputStream(new File(filePath)); 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(); } } } --- NEW FILE: StringSource.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist-db.org * * 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: StringSource.java,v 1.1 2004/05/17 09:50:29 wolfgang_m Exp $ */ package org.exist.source; import java.io.IOException; import java.io.Reader; import java.io.StringReader; /** * A simple source object wrapping around a single string value. * * @author wolf */ public class StringSource extends AbstractSource { private String data; /** * */ public StringSource(String content) { this.data = content; } /* (non-Javadoc) * @see org.exist.source.Source#getKey() */ public Object getKey() { return data; } /* (non-Javadoc) * @see org.exist.source.Source#isValid() */ public int isValid() { return Source.VALID; } /* (non-Javadoc) * @see org.exist.source.Source#isValid(org.exist.source.Source) */ public int isValid(Source other) { return Source.VALID; } /* (non-Javadoc) * @see org.exist.source.Source#getReader() */ public Reader getReader() throws IOException { return new StringReader(data); } /* (non-Javadoc) * @see org.exist.source.Source#getContent() */ public String getContent() throws IOException { return data; } } --- NEW FILE: AbstractSource.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist-db.org * * 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: AbstractSource.java,v 1.1 2004/05/17 09:50:29 wolfgang_m Exp $ */ package org.exist.source; /** * @author wolf */ public abstract class AbstractSource implements Source { private long cacheTime = 0; /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object obj) { return getKey().equals(((Source)obj).getKey()); } /* (non-Javadoc) * @see java.lang.Object#hashCode() */ public int hashCode() { return getKey().hashCode(); } /* (non-Javadoc) * @see org.exist.source.Source#getCacheTimestamp() */ public long getCacheTimestamp() { return cacheTime; } /* (non-Javadoc) * @see org.exist.source.Source#setCacheTimestamp(long) */ public void setCacheTimestamp(long timestamp) { cacheTime = timestamp; } } --- NEW FILE: CocoonSource.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist-db.org * * 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: CocoonSource.java,v 1.1 2004/05/17 09:50:29 wolfgang_m Exp $ */ package org.exist.source; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import org.apache.excalibur.source.Source; import org.apache.excalibur.source.SourceValidity; /** * @author wolf */ public class CocoonSource extends AbstractSource { private Source inputSource; private SourceValidity validity; /** * */ public CocoonSource(Source source) { inputSource = source; validity = source.getValidity(); } /* (non-Javadoc) * @see org.exist.source.Source#isValid() */ public int isValid() { int valid = validity.isValid(); switch(valid) { case SourceValidity.UNKNOWN: return UNKNOWN; case SourceValidity.VALID: return VALID; default: return INVALID; } } /* (non-Javadoc) * @see org.exist.source.Source#isValid(org.exist.source.Source) */ public int isValid(org.exist.source.Source other) { int valid = validity.isValid(((CocoonSource)other).validity); switch(valid) { case SourceValidity.UNKNOWN: return UNKNOWN; case SourceValidity.VALID: return VALID; default: return INVALID; } } /* (non-Javadoc) * @see org.exist.source.Source#getReader() */ public Reader getReader() throws IOException { InputStream is = inputSource.getInputStream(); return new InputStreamReader(is, "UTF-8"); } public String getContent() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream((int) inputSource .getContentLength()); byte[] t = new byte[512]; InputStream is = inputSource.getInputStream(); int count = 0; while ((count = is.read(t)) != -1) { os.write(t, 0, count); } return os.toString("UTF-8"); } /* (non-Javadoc) * @see org.exist.source.Source#getKey() */ public Object getKey() { return inputSource.getURI(); } } |
From: Wolfgang M. M. <wol...@us...> - 2004-05-17 09:48:29
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6802/src/org/exist/source Log Message: Directory /cvsroot/exist/eXist-1.0/src/org/exist/source added to the repository |
From: Wolfgang M. M. <wol...@us...> - 2004-05-13 12:33:20
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/request In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26461/src/org/exist/xquery/functions/request Modified Files: RequestParameter.java RequestModule.java Added Files: InvalidateSession.java Log Message: Added request:invalidate-session(). Changed request:request-parameter() to ignore the type of the default value. --- NEW FILE: InvalidateSession.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist-db.org * * 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: InvalidateSession.java,v 1.1 2004/05/13 12:33:08 wolfgang_m Exp $ */ package org.exist.xquery.functions.request; import org.exist.dom.QName; import org.exist.http.servlets.SessionWrapper; import org.exist.xquery.BasicFunction; import org.exist.xquery.Cardinality; import org.exist.xquery.FunctionSignature; import org.exist.xquery.Variable; import org.exist.xquery.XPathException; import org.exist.xquery.XQueryContext; import org.exist.xquery.value.JavaObjectValue; import org.exist.xquery.value.Sequence; import org.exist.xquery.value.SequenceType; import org.exist.xquery.value.Type; /** * @author wolf */ public class InvalidateSession extends BasicFunction { public final static FunctionSignature signature = new FunctionSignature( new QName("invalidate-session", RequestModule.NAMESPACE_URI, RequestModule.PREFIX), "Invalidate (remove) the current HTTP session if present", null, new SequenceType(Type.ITEM, Cardinality.EMPTY)); /** * @param context * @param signature */ public InvalidateSession(XQueryContext context) { super(context, signature); } /* (non-Javadoc) * @see org.exist.xquery.BasicFunction#eval(org.exist.xquery.value.Sequence[], org.exist.xquery.value.Sequence) */ public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException { RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI); // session object is read from global variable $session Variable var = myModule.resolveVariable(RequestModule.SESSION_VAR); if(var == null || var.getValue() == null) throw new XPathException("Session not set"); if(var.getValue().getItemType() != Type.JAVA_OBJECT) throw new XPathException("Variable $session is not bound to an Java object."); JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0); if(value.getObject() instanceof SessionWrapper) { SessionWrapper session = (SessionWrapper)value.getObject(); session.invalidate(); return Sequence.EMPTY_SEQUENCE; } else throw new XPathException("Type error: variable $session is not bound to a session object"); } } Index: RequestModule.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/request/RequestModule.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RequestModule.java 21 Feb 2004 17:56:53 -0000 1.2 --- RequestModule.java 13 May 2004 12:33:08 -0000 1.3 *************** *** 44,47 **** --- 44,48 ---- new FunctionDef(GetSessionAttribute.signature, GetSessionAttribute.class), new FunctionDef(SetSessionAttribute.signature, SetSessionAttribute.class), + new FunctionDef(InvalidateSession.signature, InvalidateSession.class), new FunctionDef(RequestParameter.signature, RequestParameter.class), new FunctionDef(RequestParameterNames.signature, RequestParameterNames.class), Index: RequestParameter.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/request/RequestParameter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RequestParameter.java 18 Feb 2004 10:14:55 -0000 1.2 --- RequestParameter.java 13 May 2004 12:33:08 -0000 1.3 *************** *** 48,54 **** RequestModule.NAMESPACE_URI, RequestModule.PREFIX), new SequenceType[] { new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE), ! new SequenceType(Type.STRING, Cardinality.ZERO_OR_MORE)}, new SequenceType(Type.STRING, Cardinality.ZERO_OR_MORE)); --- 48,56 ---- RequestModule.NAMESPACE_URI, RequestModule.PREFIX), + "Returns the HTTP request parameter identified by $a. If the parameter could not be found, " + + "the default value specified in $b is returned instead.", new SequenceType[] { new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE), ! new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)}, new SequenceType(Type.STRING, Cardinality.ZERO_OR_MORE)); |
From: Wolfgang M. M. <wol...@us...> - 2004-05-13 12:31:44
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26137/src/org/exist/xquery Modified Files: XPathUtil.java Log Message: Changed javaObjectToXPath() to return the correct subtypes for int, short ... Index: XPathUtil.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/XPathUtil.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** XPathUtil.java 29 Jan 2004 15:06:42 -0000 1.1 --- XPathUtil.java 13 May 2004 12:31:32 -0000 1.2 *************** *** 30,33 **** --- 30,34 ---- import org.exist.xquery.value.BooleanValue; import org.exist.xquery.value.DoubleValue; + import org.exist.xquery.value.FloatValue; import org.exist.xquery.value.IntegerValue; import org.exist.xquery.value.Item; *************** *** 51,63 **** return new BooleanValue(((Boolean) obj).booleanValue()); else if (obj instanceof Float) ! return new DoubleValue(((Float) obj).doubleValue()); else if (obj instanceof Double) return new DoubleValue(((Double) obj).doubleValue()); else if (obj instanceof Short) ! return new IntegerValue(((Short) obj).longValue()); else if (obj instanceof Integer) ! return new IntegerValue(((Integer) obj).longValue()); else if (obj instanceof Long) ! return new IntegerValue(((Long) obj).longValue()); else if (obj instanceof List) { boolean createNodeSequence = true; --- 52,64 ---- return new BooleanValue(((Boolean) obj).booleanValue()); else if (obj instanceof Float) ! return new FloatValue(((Float) obj).floatValue()); else if (obj instanceof Double) return new DoubleValue(((Double) obj).doubleValue()); else if (obj instanceof Short) ! return new IntegerValue(((Short) obj).shortValue(), Type.SHORT); else if (obj instanceof Integer) ! return new IntegerValue(((Integer) obj).intValue(), Type.INT); else if (obj instanceof Long) ! return new IntegerValue(((Long) obj).longValue(), Type.LONG); else if (obj instanceof List) { boolean createNodeSequence = true; |
From: Wolfgang M. M. <wol...@us...> - 2004-05-13 12:30:32
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/cocoon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25827/src/org/exist/cocoon Modified Files: XQueryGenerator.java Log Message: Test if user and password session attributes are strings. If not, convert them. Index: XQueryGenerator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/cocoon/XQueryGenerator.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** XQueryGenerator.java 3 May 2004 12:51:50 -0000 1.15 --- XQueryGenerator.java 13 May 2004 12:30:13 -0000 1.16 *************** *** 189,194 **** // check if user and password can be read from the session if (session != null && request.isRequestedSessionIdValid()) { ! user = (String) session.getAttribute("user"); ! password = (String) session.getAttribute("password"); } if (user == null) --- 189,196 ---- // check if user and password can be read from the session if (session != null && request.isRequestedSessionIdValid()) { ! Object userObj = session.getAttribute("user"); ! Object passObj = session.getAttribute("password"); ! user = userObj == null ? null : String.valueOf(userObj); ! password = passObj == null ? null : String.valueOf(passObj); } if (user == null) |
From: Wolfgang M. M. <wol...@us...> - 2004-05-13 09:34:25
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22281/src/org/exist/dom Modified Files: BinaryDocument.java Log Message: Fixed BinaryDocument.read() method signature. Index: BinaryDocument.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/BinaryDocument.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BinaryDocument.java 3 May 2004 13:08:42 -0000 1.3 --- BinaryDocument.java 13 May 2004 09:34:16 -0000 1.4 *************** *** 32,35 **** --- 32,36 ---- import org.exist.storage.DBBroker; import org.exist.storage.io.VariableByteArrayInput; + import org.exist.storage.io.VariableByteInput; import org.exist.storage.io.VariableByteOutputStream; *************** *** 96,100 **** } ! public void read(VariableByteArrayInput istream) throws IOException, EOFException { docId = istream.readInt(); --- 97,101 ---- } ! public void read(VariableByteInput istream) throws IOException, EOFException { docId = istream.readInt(); |
From: Wolfgang M. M. <wol...@us...> - 2004-05-12 10:18:59
|
Update of /cvsroot/exist/eXist-1.0/lib/optional In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21747/lib/optional Removed Files: cocoon.jar Log Message: Removed duplicate cocoon.jar --- cocoon.jar DELETED --- |
From: Wolfgang M. M. <wol...@us...> - 2004-05-11 08:57:06
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1519/src/org/exist/xquery/functions/text Modified Files: AbstractMatchFunction.java Log Message: Regexp parameters to functions match-all() and match-any() can now be specified as a sequence. Index: AbstractMatchFunction.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/text/AbstractMatchFunction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractMatchFunction.java 1 Mar 2004 13:20:35 -0000 1.1 --- AbstractMatchFunction.java 11 May 2004 08:56:51 -0000 1.2 *************** *** 61,65 **** } ! protected String[] getSearchTerms(XQueryContext context, Sequence contextSequence) throws XPathException { --- 61,65 ---- } ! protected List getSearchTerms(XQueryContext context, Sequence contextSequence) throws XPathException { *************** *** 76,80 **** tokens.add(word); } ! return (String[]) tokens.toArray(new String[tokens.size()]); } } --- 76,80 ---- tokens.add(word); } ! return tokens; } } |
From: Wolfgang M. M. <wol...@us...> - 2004-05-11 08:24:46
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27915/src/org/exist/xquery/functions Modified Files: ExtRegexp.java ExtRegexpOr.java Log Message: Regexp parameters to functions match-all() and match-any() can now be specified as a sequence. Index: ExtRegexpOr.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/ExtRegexpOr.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ExtRegexpOr.java 29 Jan 2004 15:06:41 -0000 1.1 --- ExtRegexpOr.java 11 May 2004 08:24:28 -0000 1.2 *************** *** 45,49 **** new SequenceType[] { new SequenceType(Type.NODE, Cardinality.ZERO_OR_MORE), ! new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)}, new SequenceType(Type.NODE, Cardinality.ZERO_OR_MORE), true); --- 45,49 ---- new SequenceType[] { new SequenceType(Type.NODE, Cardinality.ZERO_OR_MORE), ! new SequenceType(Type.STRING, Cardinality.ONE_OR_MORE)}, new SequenceType(Type.NODE, Cardinality.ZERO_OR_MORE), true); Index: ExtRegexp.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/ExtRegexp.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExtRegexp.java 1 Mar 2004 13:20:35 -0000 1.2 --- ExtRegexp.java 11 May 2004 08:24:28 -0000 1.3 *************** *** 23,26 **** --- 23,29 ---- package org.exist.xquery.functions; + import java.util.ArrayList; + import java.util.List; + import org.exist.dom.ExtArrayNodeSet; import org.exist.dom.NodeSet; *************** *** 55,59 **** new SequenceType[] { new SequenceType(Type.NODE, Cardinality.ZERO_OR_MORE), ! new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE) }, new SequenceType(Type.NODE, Cardinality.ZERO_OR_MORE), --- 58,62 ---- new SequenceType[] { new SequenceType(Type.NODE, Cardinality.ZERO_OR_MORE), ! new SequenceType(Type.STRING, Cardinality.ONE_OR_MORE) }, new SequenceType(Type.NODE, Cardinality.ZERO_OR_MORE), *************** *** 105,109 **** ? contextSequence.toNodeSet() : path.eval(contextSequence).toNodeSet(); ! String[] terms = getSearchTerms(context, contextSequence); return evalQuery(context, nodes, terms); } else { --- 108,112 ---- ? contextSequence.toNodeSet() : path.eval(contextSequence).toNodeSet(); ! List terms = getSearchTerms(context, contextSequence); return evalQuery(context, nodes, terms); } else { *************** *** 117,121 **** ) { current = i.nextItem(); ! String[] terms = getSearchTerms(context, current.toSequence()); long start = System.currentTimeMillis(); nodes = --- 120,124 ---- ) { current = i.nextItem(); ! List terms = getSearchTerms(context, current.toSequence()); long start = System.currentTimeMillis(); nodes = *************** *** 143,157 **** XQueryContext context, NodeSet nodes, ! String[] terms) throws XPathException { ! if(terms == null || terms.length == 0) return Sequence.EMPTY_SEQUENCE; // no search terms ! NodeSet hits[] = new NodeSet[terms.length]; ! for (int k = 0; k < terms.length; k++) { hits[k] = context.getBroker().getTextEngine().getNodesContaining( nodes.getDocumentSet(), nodes, ! terms[k], DBBroker.MATCH_REGEXP); } NodeSet result = hits[0]; --- 146,160 ---- XQueryContext context, NodeSet nodes, ! List terms) throws XPathException { ! if(terms == null || terms.size() == 0) return Sequence.EMPTY_SEQUENCE; // no search terms ! NodeSet hits[] = new NodeSet[terms.size()]; ! for (int k = 0; k < terms.size(); k++) { hits[k] = context.getBroker().getTextEngine().getNodesContaining( nodes.getDocumentSet(), nodes, ! (String)terms.get(k), DBBroker.MATCH_REGEXP); } NodeSet result = hits[0]; *************** *** 167,178 **** } ! protected String[] getSearchTerms(XQueryContext context, Sequence contextSequence) throws XPathException { if(getArgumentCount() < 2) throw new XPathException(getASTNode(), "function requires at least 2 arguments"); ! String[] terms = new String[getArgumentCount() - 1]; Expression next; for(int i = 1; i < getLength(); i++) { next = getArgument(i); ! terms[i - 1] = next.eval(contextSequence).getStringValue(); } return terms; --- 170,189 ---- } ! protected List getSearchTerms(XQueryContext context, Sequence contextSequence) throws XPathException { if(getArgumentCount() < 2) throw new XPathException(getASTNode(), "function requires at least 2 arguments"); ! List terms = new ArrayList(); Expression next; + Sequence seq; for(int i = 1; i < getLength(); i++) { next = getArgument(i); ! seq = next.eval(contextSequence); ! if(seq.getLength() == 1) ! terms.add(seq.itemAt(0).getStringValue()); ! else { ! for(SequenceIterator it = seq.iterate(); it.hasNext(); ) { ! terms.add(it.nextItem().getStringValue()); ! } ! } } return terms; |
From: Wolfgang M. M. <wol...@us...> - 2004-05-11 08:10:50
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25500/src/org/exist/xmldb Modified Files: DatabaseImpl.java Log Message: Check for a possible final slash in the collection URI and remove it. Index: DatabaseImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/DatabaseImpl.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DatabaseImpl.java 3 May 2004 12:58:11 -0000 1.14 --- DatabaseImpl.java 11 May 2004 08:10:39 -0000 1.15 *************** *** 140,143 **** --- 140,145 ---- String address = DEFAULT_HOST; String c = collection.substring( selector.length() ); + if(c.endsWith("/") && c.length() > 1) + c = c.substring(0, c.length() - 1); Collection current = null; if ( c.startsWith( "///" ) ) { |
From: Wolfgang M. M. <wol...@us...> - 2004-05-11 07:50:53
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/store In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21701/src/org/exist/storage/store Modified Files: NodeIterator.java Log Message: Removed misleading log message: "unexpected overflow page ...". Index: NodeIterator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/NodeIterator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NodeIterator.java 10 May 2004 11:22:42 -0000 1.8 --- NodeIterator.java 11 May 2004 07:50:40 -0000 1.9 *************** *** 151,156 **** // overflow page? load the overflow value if(l == DOMFile.OVERFLOW) { ! LOG.warn("unexpected overflow page at " + p.getPageNum() + "; tid = " + ! ItemId.getId(lastTID) + "; offset = " + offset + "; skipped = " + skipped); l = 8; final long overflow = ByteConversion.byteToLong(p.data, offset); --- 151,156 ---- // overflow page? load the overflow value if(l == DOMFile.OVERFLOW) { ! // LOG.warn("unexpected overflow page at " + p.getPageNum() + "; tid = " + ! // ItemId.getId(lastTID) + "; offset = " + offset + "; skipped = " + skipped); l = 8; final long overflow = ByteConversion.byteToLong(p.data, offset); |
From: Wolfgang M. M. <wol...@us...> - 2004-05-10 12:10:43
|
Update of /cvsroot/exist/eXist-1.0/lib/optional In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3784/lib/optional Modified Files: README.cocoon Log Message: Updated to Cocoon 2.1.4 Index: README.cocoon =================================================================== RCS file: /cvsroot/exist/eXist-1.0/lib/optional/README.cocoon,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README.cocoon 29 Jan 2004 15:06:49 -0000 1.2 --- README.cocoon 10 May 2004 12:10:34 -0000 1.3 *************** *** 2,6 **** SOAP access) and Cocoon. ! The included Cocoon version is 2.1.3. It has been built with the following blocks: --- 2,6 ---- SOAP access) and Cocoon. ! The included Cocoon version is 2.1.4. It has been built with the following blocks: |
From: Wolfgang M. M. <wol...@us...> - 2004-05-10 12:08:04
|
Update of /cvsroot/exist/eXist-1.0/webapp/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3116/webapp/xquery Modified Files: sitemap.xmap Log Message: Updated to Cocoon 2.1.4 Index: sitemap.xmap =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/xquery/sitemap.xmap,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sitemap.xmap 29 Mar 2004 14:15:12 -0000 1.11 --- sitemap.xmap 10 May 2004 12:07:23 -0000 1.12 *************** *** 7,12 **** <map:components> <map:generators default="file"> ! <map:generator name="xquery" logger="sitemap.generator.xquery" ! src="org.exist.cocoon.XQueryGenerator"/> </map:generators> <map:readers default="resource"/> --- 7,14 ---- <map:components> <map:generators default="file"> ! <map:generator name="xquery" ! logger="sitemap.generator.xquery" ! src="org.exist.cocoon.XQueryGenerator"> ! </map:generator> </map:generators> <map:readers default="resource"/> *************** *** 32,36 **** <map:match pattern="xquery.xq"> ! <map:generate src="xquery.xq" type="xquery"/> <map:transform type="xinclude"/> <map:transform src="context://stylesheets/doc2html-2.xsl"/> --- 34,39 ---- <map:match pattern="xquery.xq"> ! <map:generate src="xquery.xq" type="xquery"> ! </map:generate> <map:transform type="xinclude"/> <map:transform src="context://stylesheets/doc2html-2.xsl"/> *************** *** 117,122 **** <map:generate src="{1}.xq" type="xquery"> <map:parameter name="file" value="{1}.xq"/> - <map:parameter name="sitemap" - value="Hello World"/> </map:generate> <map:serialize encoding="UTF-8" type="html"/> --- 120,123 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-05-10 12:08:04
|
Update of /cvsroot/exist/eXist-1.0/webapp/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3116/webapp/WEB-INF Modified Files: web.xml cocoon.xconf Log Message: Updated to Cocoon 2.1.4 Index: cocoon.xconf =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/WEB-INF/cocoon.xconf,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** cocoon.xconf 29 Jan 2004 15:06:46 -0000 1.8 --- cocoon.xconf 10 May 2004 12:07:24 -0000 1.9 *************** *** 54,84 **** | | reload-scripts (boolean value, default false): ! | ! | whether to check if the scripts source files are ! | modified. Checking for modification is an expensive ! | operation, so leave it disabled in a production ! | environment. If not present it is assumed to be "false". When ! | "true" *all* script files are checked for modification on ! | each function invocation done using <map:call ! | function="...">, but not more frequent than the value of ! | "check-time" (see below). | | check-time (long value, default 1000): ! | ! | time in miliseconds between the checks for the last ! | modification date of script files. | | debugger (boolean value, default false): ! | ! | whether support for the JavaScript debugger should be enabled ! | in the control flow. +--> ! <flow-interpreters default="JavaScript" logger="flow"> ! <component-instance class="org.apache.cocoon.components.flow.javascript.JavaScriptInterpreter" name="JavaScript"> ! <load-on-startup>resource://org/apache/cocoon/components/flow/javascript/system.js</load-on-startup> <reload-scripts>true</reload-scripts> <check-time>4000</check-time> <!-- <debugger>enabled</debugger> --> <!-- JavaScript Debugger support --> </component-instance> </flow-interpreters> --- 54,89 ---- | | reload-scripts (boolean value, default false): ! | whether to check if the scripts source files are modified. ! | Checking for modification is an expensive operation, so leave ! | it disabled in a production environment. If not present it is ! | assumed to be "false". When "true" *all* script files are ! | checked for modification on each function invocation done using ! | <map:call function="...">, but not more frequent than the value ! | of "check-time" (see below). | | check-time (long value, default 1000): ! | time in miliseconds between the checks for the last modification ! | date of script files. | | debugger (boolean value, default false): ! | whether support for the JavaScript debugger should be enabled in ! | the control flow. +--> ! <flow-interpreters default="javascript" logger="flow"> ! <!-- FOM (Flow Object Model) --> ! <component-instance class="org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter" name="javascript"> ! <load-on-startup>resource://org/apache/cocoon/components/flow/javascript/fom/fom_system.js</load-on-startup> <reload-scripts>true</reload-scripts> <check-time>4000</check-time> <!-- <debugger>enabled</debugger> --> <!-- JavaScript Debugger support --> </component-instance> + <!-- (Deprecated) Original + <component-instance name="JavaScript" class="org.apache.cocoon.components.flow.javascript.JavaScriptInterpreter"> + <load-on-startup>resource://org/apache/cocoon/components/flow/javascript/system.js</load-on-startup> + <reload-scripts>true</reload-scripts> + <check-time>4000</check-time> + <debugger>enabled</debugger> + </component-instance> + --> </flow-interpreters> *************** *** 153,156 **** --- 158,162 ---- <component-instance class="org.apache.cocoon.components.modules.input.JXPathMetaModule" logger="core.modules.input" name="jxpath"/> <component-instance class="org.apache.cocoon.components.modules.input.SimpleMappingMetaModule" logger="core.modules.input" name="simplemap"/> + <component-instance class="org.apache.cocoon.components.modules.input.LocateResource" logger="core.modules.input" name="locate"/> <component-instance class="org.apache.cocoon.components.modules.input.ChainMetaModule" logger="core.modules.input" name="chain"> <input-module name="request-param"/> *************** *** 159,163 **** --- 165,194 ---- <input-module name="defaults"/> </component-instance> + <component-instance class="org.apache.cocoon.components.modules.input.PropertiesFileModule" logger="core.modules.input" name="cocoon-properties"> + <file src="resource://org/apache/cocoon/cocoon.properties"/> + </component-instance> + + <!-- The 'defaults', 'myxml' and 'slashdot' input modules are used + in the samples --> + <component-instance class="org.apache.cocoon.components.modules.input.DefaultsModule" logger="core.modules.input" name="defaults"> + <values> + <skin>defaultSkin</skin> + <base-url>http://localhost:8080/cocoon</base-url> + </values> + </component-instance> + + <component-instance class="org.apache.cocoon.components.modules.input.XMLFileModule" logger="core.modules.xml" name="myxml"> + <file src="context:///samples/modules/forrestconf.xml"/> + </component-instance> + <component-instance class="org.apache.cocoon.components.modules.input.XMLFileModule" logger="core.modules.xml" name="slashdot"> + <file src="http://slashdot.org/slashdot.rss"/> + </component-instance> + <!--..... Start configuration from 'db-modules-input' --> + + + <component-instance class="org.apache.cocoon.components.modules.input.CollectionMetaModule" logger="core.modules.input" name="collection"/> + + <!--..... End configuration from 'db-modules-input' --> </input-modules> *************** *** 198,220 **** <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/> <component-instance class="org.apache.cocoon.components.source.impl.SitemapSourceFactory" name="cocoon"/> <!-- the "*" protocol handles all uri schemes that are not explicitely specified. This includes all ! JDK standard protocols, with special handling of the "file:" protocol which is modifiable ! (can be written to) and traversable (directory structures can be crawled). --> <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/> ! <!-- xmldb pseudo protocol --> <component-instance class="org.apache.cocoon.components.source.impl.XMLDBSourceFactory" name="xmldb"> ! ! <!--#######################################################--> ! <!-- XMLDB driver for eXist --> ! <!--#######################################################--> ! <driver class="org.exist.xmldb.DatabaseImpl" type="exist"/> ! ! <!-- Xindice driver --> ! <!--driver class="org.apache.xindice.client.xmldb.DatabaseImpl" type="xindice"/--> </component-instance> ! </source-factories> <!--+ --- 229,256 ---- <component-instance class="org.apache.cocoon.components.source.impl.ContextSourceFactory" name="context"/> <component-instance class="org.apache.cocoon.components.source.impl.SitemapSourceFactory" name="cocoon"/> + <!-- The "file:" protocol is modifiable (can be written to) and traversable (directory structures + can be crawled). --> + <component-instance class="org.apache.excalibur.source.impl.FileSourceFactory" name="file"/> + <component-instance class="org.apache.cocoon.components.source.impl.PartSourceFactory" name="upload"/> <!-- the "*" protocol handles all uri schemes that are not explicitely specified. This includes all ! JDK standard protocols. --> <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/> ! <!--..... Start configuration from 'blob' --> ! ! ! <!-- blob pseudo protocol --> ! <component-instance class="org.apache.cocoon.components.source.impl.BlobSourceFactory" name="blob"/> ! ! <!--..... End configuration from 'blob' --> ! <!--..... Start configuration from 'xmldb' --> ! <!-- xmldb pseudo protocol --> <component-instance class="org.apache.cocoon.components.source.impl.XMLDBSourceFactory" name="xmldb"> ! <!-- Add here other XML:DB compliant databases drivers --> ! <driver class="org.exist.xmldb.DatabaseImpl" type="exist"/> </component-instance> ! <!--..... End configuration from 'xmldb' --> </source-factories> <!--+ *************** *** 261,269 **** | XML Parser | ! | The default parser used in Apache Cocoon is ! | org.apache.excalibur.xml.impl.JaxpParser. Apache Cocoon requires a ! | JAXP 1.1 parser. ! | If you have problems because your servlet environment uses its own ! | parser not conforming to JAXP 1.1 try using the alternative | XercesParser instead of the JaxpParser. To activate the XercesParser, | change the class attribute to --- 297,304 ---- | XML Parser | ! | Apache Cocoon requires a JAXP 1.1 parser. The default parser is ! | org.apache.excalibur.xml.impl.JaxpParser. ! | Note: If you have problems because your servlet environment uses its ! | own parser not conforming to JAXP 1.1 try using the alternative | XercesParser instead of the JaxpParser. To activate the XercesParser, | change the class attribute to *************** *** 273,280 **** | -Dorg.apache.excalibur.xml.sax.SAXParser=org.apache.excalibur.xml.impl.XercesParser | ! | Configuration for the JaxpParser (not the XercesParser!): ! | - validate (boolean, default = false): This parameter causes the parser ! | to be a validating parser. ! | XML validation is only being used for the documentation build. | (If you are going to use it elsewhere, then do so with caution.) | You really should have validated all of your XML documents already, --- 308,315 ---- | -Dorg.apache.excalibur.xml.sax.SAXParser=org.apache.excalibur.xml.impl.XercesParser | ! | Configuration parameters for the JaxpParser (not the XercesParser!): ! | - validate (boolean, default = false): should the parser validate ! | parsed documents? ! | Note: XML validation is only being used for the documentation build. | (If you are going to use it elsewhere, then do so with caution.) | You really should have validated all of your XML documents already, *************** *** 282,286 **** | to do it. | - namespace-prefixes (boolean, default = false) : do we want ! | namespaces declarations also as 'xmlns:' attributes ? | Note : setting this to true confuses some XSL processors | (e.g. Saxon). --- 317,321 ---- | to do it. | - namespace-prefixes (boolean, default = false) : do we want ! | namespaces declarations also as 'xmlns:' attributes? | Note : setting this to true confuses some XSL processors | (e.g. Saxon). *************** *** 294,321 **** | in case of parsing errors : some parsers (e.g. Xerces) do not like | to be reused after failure. ! | - sax-parser-factory (string) : the name of the SAXParserFactory ! | implementation class to be used instead of using the standard ! | JAXP mechanism (SAXParserFactory.newInstance()). This allows to ! | choose unambiguously the JAXP implementation to be used when ! | several of them are available in the classpath. ! | - document-builder-factory (string) : the name of the | DocumentBuilderFactory implementation to be used (similar to | sax-parser-factory for DOM). +--> ! <xml-parser class="org.apache.excalibur.xml.impl.JaxpParser" logger="core.xml-parser" ! pool-grow="4" pool-max="32" pool-min="8"> <parameter name="validate" value="false"/> ! <parameter name="namespace-prefixes" value="true"/> <parameter name="stop-on-warning" value="true"/> ! <parameter name="stop-on-recoverable-error" value="false"/> <parameter name="reuse-parsers" value="false"/> - <!--parameter name="sax-parser-factory" value="???"/--> - <!--parameter name="document-builder-factory" value="???"/--> - <!-- drop-dtd-comments: causes all comment events originating from DTD - comments to be dropped right after parsing --> <parameter name="drop-dtd-comments" value="true"/> </xml-parser> - <!--+ | XSLT Processor --- 329,355 ---- | in case of parsing errors : some parsers (e.g. Xerces) do not like | to be reused after failure. ! | - sax-parser-factory (string, optional) : the name of the ! | SAXParserFactory implementation class to be used instead of using ! | the standard JAXP mechanism (SAXParserFactory.newInstance()). This ! | allows to choose unambiguously the JAXP implementation to be used ! | when several of them are available in the classpath. ! | - document-builder-factory (string, optional) : the name of the | DocumentBuilderFactory implementation to be used (similar to | sax-parser-factory for DOM). + | - drop-dtd-comments : should comment() events from DTD's be dropped? + | Note: Since this implementation does not support the DeclHandler + | interface anyway, it is quite useless to only have the comments + | from DTD. And the comment events from the internal DTD subset + | would appear in the serialized output again. +--> ! <xml-parser class="org.apache.excalibur.xml.impl.JaxpParser" logger="core.xml-parser" pool-grow="4" pool-max="32" pool-min="8"> <parameter name="validate" value="false"/> ! <parameter name="namespace-prefixes" value="false"/> <parameter name="stop-on-warning" value="true"/> ! <parameter name="stop-on-recoverable-error" value="true"/> <parameter name="reuse-parsers" value="false"/> <parameter name="drop-dtd-comments" value="true"/> </xml-parser> <!--+ | XSLT Processor *************** *** 335,339 **** +--> <xslt-processor logger="core.xslt-processor"> ! <parameter name="use-store" value="false"/> <parameter name="incremental-processing" value="false"/> </xslt-processor> --- 369,373 ---- +--> <xslt-processor logger="core.xslt-processor"> ! <parameter name="use-store" value="true"/> <parameter name="incremental-processing" value="false"/> </xslt-processor> *************** *** 345,349 **** +--> <component class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl" logger="core.xslt-processor" role="org.apache.excalibur.xml.xslt.XSLTProcessor/xsltc"> ! <parameter name="use-store" value="false"/> <parameter name="transformer-factory" value="org.apache.xalan.xsltc.trax.TransformerFactoryImpl"/> </component> --- 379,383 ---- +--> <component class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl" logger="core.xslt-processor" role="org.apache.excalibur.xml.xslt.XSLTProcessor/xsltc"> ! <parameter name="use-store" value="true"/> <parameter name="transformer-factory" value="org.apache.xalan.xsltc.trax.TransformerFactoryImpl"/> </component> *************** *** 353,357 **** +--> <component class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl" logger="core.xslt-processor" role="org.apache.excalibur.xml.xslt.XSLTProcessor/xalan"> ! <parameter name="use-store" value="false"/> <parameter name="incremental-processing" value="false"/> <parameter name="transformer-factory" value="org.apache.xalan.processor.TransformerFactoryImpl"/> --- 387,391 ---- +--> <component class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl" logger="core.xslt-processor" role="org.apache.excalibur.xml.xslt.XSLTProcessor/xalan"> ! <parameter name="use-store" value="true"/> <parameter name="incremental-processing" value="false"/> <parameter name="transformer-factory" value="org.apache.xalan.processor.TransformerFactoryImpl"/> *************** *** 364,374 **** | For new (7.x?) Saxon use: | <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/> - --> <component logger="core.xslt-processor" role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon" class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl"> ! <parameter name="use-store" value="false"/> ! <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/> </component> <!-- Xpath Processor: --> --- 398,408 ---- | For new (7.x?) Saxon use: | <parameter name="transformer-factory" value="net.sf.saxon.TransformerFactoryImpl"/> <component logger="core.xslt-processor" role="org.apache.excalibur.xml.xslt.XSLTProcessor/saxon" class="org.apache.excalibur.xml.xslt.XSLTProcessorImpl"> ! <parameter name="use-store" value="true"/> ! <parameter name="transformer-factory" value="com.icl.saxon.TransformerFactoryImpl"/> </component> + +--> <!-- Xpath Processor: --> *************** *** 384,404 **** <!--+ | Transient Store: holds objects that don't have to survive shutdown +--> <transient-store logger="core.store.transient"> - - <!--+ - | Indicates how many objects will be hold in the cache. - | When the number of maxobjects has been reached. The last object - | in the cache will be thrown out. - +--> <parameter name="maxobjects" value="100"/> - - <!-- Turns swapping of the objects into persistent cache on and off. --> - <parameter name="use-persistent-cache" value="true"/> </transient-store> <!--+ | Persistent Store: holds objects that have to survive shutdown. ! | WARNING: FilesystemStore is broken. Cocoon uses DefaultStore based | on the Avalon Excalibur JispStore instead. | --- 418,449 ---- <!--+ | Transient Store: holds objects that don't have to survive shutdown + | + | Common configuration parameters: + | maxobjects: Indicates how many objects will be hold in the cache. + | When the number of maxobjects has been reached. The last object + | in the cache will be thrown out. +--> <transient-store logger="core.store.transient"> <parameter name="maxobjects" value="100"/> </transient-store> + + <!--+ + | Store: generic store. The default implementation is an in-memory store + | backed by the persistent store (see below). This forms a two-stage + | cache composed of a fast in-memory MRU front-end and a persistent + | back-end storing less used objects. + | + | Common configuration parameters: + | maxobjects: Indicates how many objects will be hold in the cache. + | When the number of maxobjects has been reached. The last object + | in the cache will be thrown out. + +--> + <store logger="core.store"> + <parameter name="maxobjects" value="100"/> + </store> <!--+ | Persistent Store: holds objects that have to survive shutdown. ! | WARNING: FilesystemStore is broken. Cocoon uses DefaultPersistentStore based | on the Avalon Excalibur JispStore instead. | *************** *** 416,420 **** | order: FIXME: put description here. +--> ! <persistent-store class="org.apache.cocoon.components.store.impl.DefaultStore" logger="core.store.persistent"> <parameter name="use-cache-directory" value="true"/> <parameter name="order" value="2701"/> --- 461,465 ---- | order: FIXME: put description here. +--> ! <persistent-store logger="core.store.persistent"> <parameter name="use-cache-directory" value="true"/> <parameter name="order" value="2701"/> *************** *** 424,434 **** | Store Janitor: the store garbage collector and memory usage controller. | ! | Be careful with the heapsize and freememory parameters. Wrong values ! | can cause high cpu usage. Example configuration: | Jvm settings: | -Xmx200000000 | store-janitor settings: | <parameter name="freememory" value="5000000"/> ! | <parameter name="heapsize" value="150000000"/> | | It is recommended to have heapsize equal to -Xmx, especially on Sun's --- 469,481 ---- | Store Janitor: the store garbage collector and memory usage controller. | ! | WARNING: Be careful with the heapsize and freememory parameters. ! | Wrong values can cause high cpu usage. ! | ! | Example configuration: | Jvm settings: | -Xmx200000000 | store-janitor settings: | <parameter name="freememory" value="5000000"/> ! | <parameter name="heapsize" value="196000000"/> | | It is recommended to have heapsize equal to -Xmx, especially on Sun's *************** *** 436,448 **** | Freememory should be greater than amount of memory necessary for normal | application operation. +--> <store-janitor logger="core.store.janitor"> <!-- How much free memory shall be available in the jvm --> ! <parameter name="freememory" value="1000000"/> <!-- Indicates the limit of the jvm memory consumption. The default max ! heapsize for Sun's JVM is 64Mb --> ! <parameter name="heapsize" value="67108864"/> <!-- How often shall the cleanup thread check memory --> <parameter name="cleanupthreadinterval" value="10"/> <!-- Indicates the thread priority of the cleanup thread --> <parameter name="threadpriority" value="5"/> --- 483,502 ---- | Freememory should be greater than amount of memory necessary for normal | application operation. + | BUT: The heap size of the memory of the JVM is a little bit less than + | the value you specify for -Xmx, so you have to set the heapsize + | for the store janitor to a value which is lower (2% less seems + | to be a working value). +--> <store-janitor logger="core.store.janitor"> <!-- How much free memory shall be available in the jvm --> ! <parameter name="freememory" value="2048000"/> <!-- Indicates the limit of the jvm memory consumption. The default max ! heapsize for Sun's JVM is (almost) 64Mb --> ! <parameter name="heapsize" value="66600000"/> <!-- How often shall the cleanup thread check memory --> <parameter name="cleanupthreadinterval" value="10"/> + <!-- Experimental adaptive algorithm for cleanup interval + <parameter name="adaptivethreadinterval" value="true"/> + --> <!-- Indicates the thread priority of the cleanup thread --> <parameter name="threadpriority" value="5"/> *************** *** 450,453 **** --- 504,509 ---- shall be removed when low on memory. Default 10% --> <parameter name="percent_to_free" value="10"/> + <!-- Invoke the garbage collector when low memory is reached --> + <parameter name="invokegc" value="false"/> </store-janitor> *************** *** 467,471 **** <i18n-bundles logger="core.i18n-bundles"> <catalogue-name>messages</catalogue-name> ! <catalogue-location>i18n/translations</catalogue-location> <cache-at-startup>true</cache-at-startup> </i18n-bundles> --- 523,527 ---- <i18n-bundles logger="core.i18n-bundles"> <catalogue-name>messages</catalogue-name> ! <catalogue-location>context://samples/i18n/translations</catalogue-location> <cache-at-startup>true</cache-at-startup> </i18n-bundles> *************** *** 508,515 **** | Specifies which Java compiler to use. Possible variants are: | | - Javac: the java compiler that comes with JDK - | - Pizza: the Pizza java compiler | - Jikes: the Jikes java compiler ! | - EclipseJavaCompiler: the Eclipse JTD java compiler | | NOTE: the Eclipse JTD is the only java compiler that is capable --- 564,571 ---- | Specifies which Java compiler to use. Possible variants are: | + | - EclipseJavaCompiler: the Eclipse JTD java compiler | - Javac: the java compiler that comes with JDK | - Jikes: the Jikes java compiler ! | - Pizza: the Pizza java compiler | | NOTE: the Eclipse JTD is the only java compiler that is capable *************** *** 520,527 **** | or you might experience problems in some servlet containers. +--> ! <!--parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Javac"/--> ! <parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Pizza"/> <!--parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Jikes"/--> ! <!--parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.EclipseJavaCompiler"/--> </java-language> --- 576,583 ---- | or you might experience problems in some servlet containers. +--> ! <parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.EclipseJavaCompiler"/> ! <!--parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Javac"/--> <!--parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Jikes"/--> ! <!--parameter name="compiler" value="org.apache.cocoon.components.language.programming.java.Pizza"/--> </java-language> *************** *** 532,536 **** <!--+ ! | Logisheets | | This section defines the XSP logicsheets. A logicsheet is a special --- 588,592 ---- <!--+ ! | Logicsheets | | This section defines the XSP logicsheets. A logicsheet is a special *************** *** 658,662 **** <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/input.xsl"/> </builtin-logicsheet> ! <!-- The ESQL logicsheet is an XSP logicsheet that performs sql queries and --- 714,719 ---- <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/input.xsl"/> </builtin-logicsheet> ! <!--..... Start configuration from 'esql' --> ! <!-- The ESQL logicsheet is an XSP logicsheet that performs sql queries and *************** *** 669,680 **** </builtin-logicsheet> ! <!--#######################################################--> ! <!-- eXist's xmldb logicsheet --> ! <!--#######################################################--> ! <builtin-logicsheet> ! <parameter name="prefix" value="xdb"/> ! <parameter name="uri" value="http://exist-db.org/xmldb/1.0"/> ! <parameter name="href" value="resource://org/exist/xmldb.xsl"/> ! </builtin-logicsheet> </target-language> --- 726,736 ---- </builtin-logicsheet> ! <builtin-logicsheet> ! <parameter name="prefix" value="xdb"/> ! <parameter name="uri" value="http://exist-db.org/xmldb/1.0"/> ! <parameter name="href" value="resource://org/exist/xmldb.xsl"/> ! </builtin-logicsheet> ! ! <!--..... End configuration from 'esql' --> </target-language> *************** *** 749,782 **** --> </component> ! <!--+ ! | URL Factory ! | ! | The url factory adds special url protocols to the system, they are then ! | available inside Cocoon, e.g. as a source argument for one of the sitemap ! | components. ! | ! | THIS COMPONENT IS DEPRECATED AND SHOULD NOT BE USED ANYMORE ! +--> ! <url-factory logger="core.url-factory"> ! <!-- Allows access to resources available from the ClassLoader, using getResource() method. --> ! <protocol class="org.apache.cocoon.components.url.ResourceURLFactory" name="resource"/> ! </url-factory> ! <!--+ ! | Source Handler ! | ! | The source handler adds special url protocols to the system, they are ! | then available inside Cocoon, e.g. as a source argument for one of the ! | sitemap components. ! | ! | THIS COMPONENT IS DEPRECATED AND SHOULD NOT BE USED ANYMORE ! +--> ! <source-handler logger="core.source-handler"> ! <!-- file protocol : this is a WriteableSource --> ! <protocol class="org.apache.cocoon.components.source.FileSourceFactory" name="file"/> ! <!-- Allows access to resources available from the servlet context, using getResource() method. --> ! <protocol class="org.apache.cocoon.components.source.ContextSourceFactory" name="context"/> ! </source-handler> ! </cocoon> --- 805,857 ---- --> </component> + <!--..... Start configuration from 'datasources' --> ! <datasources> ! <jdbc logger="core.datasources.personnel" name="personnel"> ! <!-- ! If you have an Oracle database, and are using the the ! pool-controller below, you should add the attribute ! "oradb" and set it to true. ! <pool-controller min="5" max="10" oradb="true"/> ! ! That way the test to see if the server has disconnected ! the JdbcConnection will function properly. ! --> ! <pool-controller max="10" min="5"/> ! <!-- ! If you need to ensure an autocommit is set to true or ! false, then create the "auto-commit" element below. ! ! <auto-commit>false</auto-commit> ! ! The default is true. ! --> ! <dburl>jdbc:hsqldb:hsql://localhost:9002</dburl> ! <user>sa</user> ! <password/> ! </jdbc> ! </datasources> ! <!--..... End configuration from 'datasources' --> ! <!--..... Start configuration from 'db-modules' --> ! ! <!-- =============== Database Modules ==================== --> ! ! <autoincrement-modules> ! <component-instance class="org.apache.cocoon.components.modules.database.HsqlIdentityAutoIncrementModule" logger="core.modules.auto" name="auto"/> ! <!-- ! Choose the one suitable for your DBMS. You *can* have more than ! one at a time, but they need to have different names. You then ! need to specify explicitly, which one to use in your descriptor ! file. ! ! <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.ManualAutoIncrementModule"/> ! <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.IfxSerialAutoIncrementModule"/> ! <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.McKoiSequenceModule"/> ! <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.MysqlAutoIncrementModule"/> ! <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.PgsqlAutoIncrementModule"/> ! <component-instance logger="core.modules.auto" name="auto" class="org.apache.cocoon.components.modules.database.SQLServerIdentityAutoIncrementModule"/> ! --> ! </autoincrement-modules> ! <!--..... End configuration from 'db-modules' --> </cocoon> Index: web.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/WEB-INF/web.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** web.xml 24 Apr 2004 13:45:54 -0000 1.17 --- web.xml 10 May 2004 12:07:24 -0000 1.18 *************** *** 550,577 **** <taglib-location>/WEB-INF/exist.tld</taglib-location> </taglib> - - <!-- Add a security-constraint for the DatabaseAdminServlet: the servlet allows to - shutdown the database. We don't want everybody to be able to access this. --> - <security-constraint> - <web-resource-collection> - <web-resource-name>DatabaseAdmin</web-resource-name> - <url-pattern>/admin</url-pattern> - </web-resource-collection> - <auth-constraint> - <role-name>dba</role-name> - </auth-constraint> - </security-constraint> - - <login-config> - <auth-method>FORM</auth-method> - <realm-name>eXist Database Admin Realm</realm-name> - <form-login-config> - <form-login-page>adminLogin.xml</form-login-page> - <form-error-page>adminLogin.xml</form-error-page> - </form-login-config> - </login-config> - - <security-role> - <role-name>dba</role-name> - </security-role> </web-app> --- 550,552 ---- |
Update of /cvsroot/exist/eXist-1.0/lib/optional In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3116/lib/optional Modified Files: cocoon-deprecated.jar Added Files: cocoon-2.1.4.jar commons-httpclient-2.0-rc3.jar excalibur-store-1.0-dev-20040206.jar commons-collections-3.0.jar cocoon-xmldb-block.jar excalibur-component-20040122.jar xml-commons-resolver-1.1.jar commons-jexl-1.0-beta-1-20040113.jar cocoon-databases-block.jar jdtcore-2.1.0.jar Removed Files: commons-jexl-1.0-beta-1.jar excalibur-component-1.2-dev.jar excalibur-store-1.0-dev.jar xmldb-block.jar databases-block.jar commons-collections-2.1.jar commons-httpclient-2.0-rc1.jar Log Message: Updated to Cocoon 2.1.4 --- NEW FILE: commons-jexl-1.0-beta-1-20040113.jar --- (This appears to be a binary file; contents omitted.) Index: cocoon-deprecated.jar =================================================================== RCS file: /cvsroot/exist/eXist-1.0/lib/optional/cocoon-deprecated.jar,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsAFS6kk and /tmp/cvsPwdbsn differ --- excalibur-component-1.2-dev.jar DELETED --- --- NEW FILE: excalibur-component-20040122.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: jdtcore-2.1.0.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: commons-httpclient-2.0-rc3.jar --- (This appears to be a binary file; contents omitted.) --- commons-collections-2.1.jar DELETED --- --- commons-httpclient-2.0-rc1.jar DELETED --- --- xmldb-block.jar DELETED --- --- databases-block.jar DELETED --- --- NEW FILE: commons-collections-3.0.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: excalibur-store-1.0-dev-20040206.jar --- (This appears to be a binary file; contents omitted.) --- commons-jexl-1.0-beta-1.jar DELETED --- --- NEW FILE: xml-commons-resolver-1.1.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cocoon-databases-block.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cocoon-xmldb-block.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cocoon-2.1.4.jar --- (This appears to be a binary file; contents omitted.) --- excalibur-store-1.0-dev.jar DELETED --- |
From: Wolfgang M. M. <wol...@us...> - 2004-05-10 12:07:52
|
Update of /cvsroot/exist/eXist-1.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3116 Modified Files: conf.xml client.properties Log Message: Updated to Cocoon 2.1.4 Index: conf.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/conf.xml,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** conf.xml 23 Apr 2004 13:07:46 -0000 1.49 --- conf.xml 10 May 2004 12:07:24 -0000 1.50 *************** *** 74,78 **** indent="yes" add-exist-id="none" match-tagging-elements="yes" match-tagging-attributes="no"/> ! <!-- Settings for the indexer: --- 74,93 ---- indent="yes" add-exist-id="none" match-tagging-elements="yes" match-tagging-attributes="no"/> ! ! <!-- During XUpdates, the database needs to do a partial reindex of the ! document whenever the internal node-id structure has changed. Reindex ! runs can occur quite frequently and slow down the XUpdate process. ! ! Frequent reindex runs can be avoided by leaving some space between the ! numeric identifiers assigned to every node. Future insertions will first ! fill up these spare identifiers, so no reindex is required. ! ! The "growth-factor" attribute determines the number of spare ids to be ! inserted whenever the node id scheme is recomputed after an XUpdate. ! Increase the setting to have less reindex runs. However, you have to ! be aware that leaving spare ids also limits the maximum size of a ! document that can be indexed. --> ! <xupdate growth-factor="20"/> ! <!-- Settings for the indexer: *************** *** 137,144 **** equality comparisons. --> ! <index doctype="users" default="none" attributes="false"> ! </index> ! <index doctype="PLAY" default="all"> </index> <index doctype="dblp" attributes="true" alphanum="true" default="all"> <exclude path="//@mdate"/> --- 152,158 ---- equality comparisons. --> ! <index doctype="auth" default="none" attributes="false"> </index> + <index doctype="dblp" attributes="true" alphanum="true" default="all"> <exclude path="//@mdate"/> *************** *** 148,152 **** <exclude path="//url"/> </index> ! <!-- Specify the location of one or more catalog files. Catalogs are used to resolve external entities in XML documents. --- 162,174 ---- <exclude path="//url"/> </index> ! ! <index doctype="movie" attributes="true" default="all"> ! <exclude path="//@subtype"/> ! <exclude path="//@id"/> ! <exclude path="//@name"/> ! <exclude path="//@type"/> ! <exclude path="//@creditorder"/> ! </index> ! <!-- Specify the location of one or more catalog files. Catalogs are used to resolve external entities in XML documents. Index: client.properties =================================================================== RCS file: /cvsroot/exist/eXist-1.0/client.properties,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** client.properties 2 Feb 2004 15:30:31 -0000 1.15 --- client.properties 10 May 2004 12:07:39 -0000 1.16 *************** *** 36,41 **** # highlight matches in element and attribute values? ! match-tagging-elements=yes ! match-tagging-attributes=false # files with the following suffixes are stored as XML files --- 36,41 ---- # highlight matches in element and attribute values? ! # possible values are "none", "both", "elements", "attributes" ! highlight-matches=none # files with the following suffixes are stored as XML files |
From: Wolfgang M. M. <wol...@us...> - 2004-05-10 12:07:51
|
Update of /cvsroot/exist/eXist-1.0/webapp/acronyms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3116/webapp/acronyms Modified Files: query.xsp Log Message: Updated to Cocoon 2.1.4 Index: query.xsp =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/acronyms/query.xsp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** query.xsp 6 Jan 2004 14:10:16 -0000 1.7 --- query.xsp 10 May 2004 12:07:40 -0000 1.8 *************** *** 56,67 **** String path; if(field.equals("acronym")) ! path = "Acronym/@id|.//AlternateForm"; else if(field.equals("expansion")) ! path = "Acronym/@expansion"; else if(field.equals("definition")) ! path = "Definition"; else path = "."; ! String query = "//Entry[" + path + " &= " + '"' + term + "\"]"; --- 56,68 ---- String path; if(field.equals("acronym")) ! path = "a:Acronym/@id|.//a:AlternateForm"; else if(field.equals("expansion")) ! path = "a:Acronym/@expansion"; else if(field.equals("definition")) ! path = "a:Definition"; else path = "."; ! String query = "declare namespace a='http://www.xml-acronym-demystifier.org';" + ! "//a:Entry[" + path + " &= " + '"' + term + "\"]"; *************** *** 72,76 **** <xdb:collection uri="xmldb:exist:///db" user="guest" password="guest"> <xdb:execute> - <xdb:namespace prefix="">http://www.xml-acronym-demystifier.org</xdb:namespace> <xdb:xpath>query</xdb:xpath> <xdb:results position="1" count="1000"> --- 73,76 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-05-10 11:23:25
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25553/src/org/exist/storage/io Modified Files: VariableByteInput.java AbstractVariableByteInput.java VariableByteArrayInput.java VariableByteOutputStream.java Log Message: XUpdate: * Btree not correctly updated after node changes, leading to NullPointerException * Attribute values truncated * Page splitting error results in NullPointerException after a few hundred XUpdates * New configuration parameter to control XUpdate behaviour Other: * Properties passed to Collection, XPathQueryService, XQueryService had no effect. * Modified evaluation of index settings in conf.xml. Index: VariableByteOutputStream.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/io/VariableByteOutputStream.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VariableByteOutputStream.java 3 May 2004 13:01:34 -0000 1.1 --- VariableByteOutputStream.java 10 May 2004 11:22:43 -0000 1.2 *************** *** 52,56 **** } ! public void write(byte[] b) throws IOException { buf.append(b); } --- 52,56 ---- } ! public void write(byte[] b) { buf.append(b); } *************** *** 60,63 **** --- 60,67 ---- } + public void write(ByteArray b) { + b.copyTo(buf); + } + public void writeByte(byte b) { buf.append(b); Index: AbstractVariableByteInput.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/io/AbstractVariableByteInput.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractVariableByteInput.java 3 May 2004 13:01:34 -0000 1.1 --- AbstractVariableByteInput.java 10 May 2004 11:22:43 -0000 1.2 *************** *** 95,98 **** --- 95,103 ---- } + public void skipBytes(long count) throws IOException { + for(long i = 0; i < count; i++) + readByte(); + } + public int read(byte[] data) throws IOException { return read(data, 0, data.length); Index: VariableByteArrayInput.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/io/VariableByteArrayInput.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VariableByteArrayInput.java 3 May 2004 13:01:34 -0000 1.1 --- VariableByteArrayInput.java 10 May 2004 11:22:43 -0000 1.2 *************** *** 138,140 **** --- 138,145 ---- } } + + public void skipBytes(long count) throws IOException { + for(long i = 0; i < count && position < end; i++, position++) + ; + } } \ No newline at end of file Index: VariableByteInput.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/io/VariableByteInput.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VariableByteInput.java 3 May 2004 13:01:34 -0000 1.1 --- VariableByteInput.java 10 May 2004 11:22:43 -0000 1.2 *************** *** 109,112 **** --- 109,114 ---- public void skip(int count) throws IOException; + public void skipBytes(long count) throws IOException; + /** * Copy the next numeric value from the input to the |
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25553/src/org/exist/dom Modified Files: NodeImpl.java ExtArrayNodeSet.java AttrImpl.java ElementImpl.java AbstractNodeSet.java NodeProxy.java VirtualNodeSet.java Log Message: XUpdate: * Btree not correctly updated after node changes, leading to NullPointerException * Attribute values truncated * Page splitting error results in NullPointerException after a few hundred XUpdates * New configuration parameter to control XUpdate behaviour Other: * Properties passed to Collection, XPathQueryService, XQueryService had no effect. * Modified evaluation of index settings in conf.xml. Index: AbstractNodeSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/AbstractNodeSet.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AbstractNodeSet.java 25 Mar 2004 12:50:49 -0000 1.14 --- AbstractNodeSet.java 10 May 2004 11:22:39 -0000 1.15 *************** *** 44,48 **** protected final static Logger LOG = Logger.getLogger(AbstractNodeSet.class); ! protected AbstractNodeSet() { } --- 44,48 ---- protected final static Logger LOG = Logger.getLogger(AbstractNodeSet.class); ! protected AbstractNodeSet() { } *************** *** 199,203 **** public DocumentSet getDocumentSet() { - //long start = System.currentTimeMillis(); DocumentSet ds = new DocumentSet(); NodeProxy p; --- 199,202 ---- *************** *** 206,210 **** ds.add(p.doc); } - //LOG.debug("getDocumentSet took " + (System.currentTimeMillis() - start)); return ds; } --- 205,208 ---- Index: NodeImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/NodeImpl.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NodeImpl.java 30 Apr 2004 09:07:32 -0000 1.18 --- NodeImpl.java 10 May 2004 11:22:39 -0000 1.19 *************** *** 28,31 **** --- 28,32 ---- import org.apache.log4j.Logger; import org.exist.storage.DBBroker; + import org.exist.storage.NodePath; import org.exist.storage.Signatures; import org.w3c.dom.DOMException; *************** *** 329,337 **** } ! public StringBuffer getPath() { ! StringBuffer path = new StringBuffer(); Node parent = getParentNode(); while (parent.getNodeType() != Node.DOCUMENT_NODE) { ! path.append('/').append(parent.getNodeName()); parent = parent.getParentNode(); } --- 330,338 ---- } ! public NodePath getPath() { ! NodePath path = new NodePath(); Node parent = getParentNode(); while (parent.getNodeType() != Node.DOCUMENT_NODE) { ! path.addComponent(parent.getNodeName()); parent = parent.getParentNode(); } Index: NodeProxy.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/NodeProxy.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** NodeProxy.java 3 May 2004 13:08:42 -0000 1.28 --- NodeProxy.java 10 May 2004 11:22:39 -0000 1.29 *************** *** 634,638 **** public void copyTo(DBBroker broker, Receiver receiver) throws SAXException { ! receiver.addReferenceNode(this); // Serializer serializer = broker.getSerializer(); // serializer.toReceiver(this, receiver); --- 634,642 ---- public void copyTo(DBBroker broker, Receiver receiver) throws SAXException { ! if(nodeType == Node.ATTRIBUTE_NODE) { ! AttrImpl attr = (AttrImpl) getNode(); ! receiver.attribute(attr.getQName(), attr.getValue()); ! } else ! receiver.addReferenceNode(this); // Serializer serializer = broker.getSerializer(); // serializer.toReceiver(this, receiver); Index: ExtArrayNodeSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/ExtArrayNodeSet.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ExtArrayNodeSet.java 14 Apr 2004 12:17:22 -0000 1.14 --- ExtArrayNodeSet.java 10 May 2004 11:22:39 -0000 1.15 *************** *** 354,361 **** public DocumentSet getDocumentSet() { if (!isSorted) size = 0; Part part; - DocumentSet ds = new DocumentSet(); DocumentImpl doc, last = null; for (Iterator i = map.valueIterator(); i.hasNext();) { --- 354,361 ---- public DocumentSet getDocumentSet() { + DocumentSet ds = new DocumentSet(); if (!isSorted) size = 0; Part part; DocumentImpl doc, last = null; for (Iterator i = map.valueIterator(); i.hasNext();) { Index: ElementImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/ElementImpl.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ElementImpl.java 30 Apr 2004 09:07:31 -0000 1.32 --- ElementImpl.java 10 May 2004 11:22:39 -0000 1.33 *************** *** 70,74 **** protected long firstChild = -1; protected Map namespaceMappings = null; ! public ElementImpl() { super(Node.ELEMENT_NODE); --- 70,74 ---- protected long firstChild = -1; protected Map namespaceMappings = null; ! public ElementImpl() { super(Node.ELEMENT_NODE); *************** *** 257,261 **** if (ownerDocument.getTreeLevelOrder(level + 1) < children + size) { // recompute the order of the tree ! ownerDocument.setTreeLevelOrder(level + 1, children + size); ownerDocument.calculateTreeLevelStartPoints(false); if (ownerDocument.reindex < 0 || ownerDocument.reindex > level + 1) { --- 257,262 ---- if (ownerDocument.getTreeLevelOrder(level + 1) < children + size) { // recompute the order of the tree ! ownerDocument.setTreeLevelOrder(level + 1, children + size + ! ownerDocument.broker.getXUpdateGrowthFactor()); ownerDocument.calculateTreeLevelStartPoints(false); if (ownerDocument.reindex < 0 || ownerDocument.reindex > level + 1) { Index: VirtualNodeSet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/VirtualNodeSet.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** VirtualNodeSet.java 14 Apr 2004 12:17:22 -0000 1.33 --- VirtualNodeSet.java 10 May 2004 11:22:39 -0000 1.34 *************** *** 91,95 **** */ public DocumentSet getDocumentSet() { ! return context.getDocumentSet(); } --- 91,95 ---- */ public DocumentSet getDocumentSet() { ! return context.getDocumentSet(); } Index: AttrImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/AttrImpl.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** AttrImpl.java 27 Apr 2004 15:46:56 -0000 1.12 --- AttrImpl.java 10 May 2004 11:22:39 -0000 1.13 *************** *** 68,71 **** --- 68,73 ---- next += Signatures.getLength(idSizeType); String name = doc.getSymbols().getName( id ); + if(name == null) + throw new RuntimeException("no symbol for id " + id); short nsId = 0; String prefix = null; *************** *** 132,135 **** --- 134,139 ---- public byte[] serialize() { + if(nodeName.getLocalName() == null) + throw new RuntimeException("Local name is null"); final short id = ownerDocument.getSymbols().getSymbol( this ); final byte idSizeType = Signatures.getSizeType( id ); |
From: Wolfgang M. M. <wol...@us...> - 2004-05-10 11:23:24
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25553/src/org/exist/storage Modified Files: DBBroker.java IndexPaths.java NativeElementIndex.java NativeBroker.java Added Files: NodePath.java Log Message: XUpdate: * Btree not correctly updated after node changes, leading to NullPointerException * Attribute values truncated * Page splitting error results in NullPointerException after a few hundred XUpdates * New configuration parameter to control XUpdate behaviour Other: * Properties passed to Collection, XPathQueryService, XQueryService had no effect. * Modified evaluation of index settings in conf.xml. --- NEW FILE: NodePath.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-04 Wolfgang M. Meier * wol...@ex... * http://exist-db.org * * 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: NodePath.java,v 1.1 2004/05/10 11:22:41 wolfgang_m Exp $ */ package org.exist.storage; import java.util.StringTokenizer; import org.exist.util.FastStringBuffer; import org.exist.util.MutableStringTokenizer; /** * @author wolf */ public class NodePath { public final static String WILDCARD = "*"; private String[] components = new String[5]; private int pos = 0; public NodePath() { } /** * */ public NodePath(String path) { init(path); } public void addComponent(String component) { if(pos == components.length) { String[] t = new String[pos + 1]; System.arraycopy(components, 0, t, 0, pos); components = t; } components[pos++] = component; } public void removeLastComponent() { components[--pos] = null; } public final boolean match(NodePath other) { boolean skip = false; int i = 0; for(int j = 0; j < other.pos; j++) { if(i == pos) return true; if(components[i].equals(WILDCARD)) { ++i; skip = true; } if(other.components[j].equals(components[i])) { ++i; skip = false; } else if(skip) { continue; } else return false; } return i == pos; } public final boolean match( CharSequence other) { int i = 0; boolean skip = false; MutableStringTokenizer tokenizer = new MutableStringTokenizer(other, "/"); CharSequence next; while((next = tokenizer.nextToken()) != null) { if(i == pos) return true; if(components[i].equals(WILDCARD)) { ++i; skip = true; } if(next.equals(components[i])) { ++i; skip = false; } else if(skip) { continue; } else return false; } return i == pos; } public void reset() { for(int i = 0; i < components.length; i++) components[i] = null; pos = 0; } private void init( String path ) { StringTokenizer tokenizer = new StringTokenizer(path, "/"); FastStringBuffer token = new FastStringBuffer(); String next; int pos = 0; char ch = 0; final int pathLen = path.length(); while ( pos < pathLen ) { ch = path.charAt(pos); switch ( ch ) { case '/': next = token.toString(); token.reset(); if ( next.length( ) > 0 ) addComponent( next ); if ( path.charAt( ++pos ) == '/' ) addComponent( WILDCARD ); break; default: token.append(ch); pos++; } } if ( token.length() > 0 ) addComponent( token.toString() ); } } Index: NativeBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeBroker.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** NativeBroker.java 3 May 2004 13:08:43 -0000 1.65 --- NativeBroker.java 10 May 2004 11:22:41 -0000 1.66 *************** *** 110,113 **** --- 110,114 ---- private static final String ROOT_COLLECTION = "/db"; private static final String EXCEPTION_DURING_REINDEX = "exception during reindex"; + /** default buffer size setting */ protected final static int BUFFERS = 256; *************** *** 116,133 **** protected final static int MEM_LIMIT_CHECK = 10000; protected CollectionStore collectionsDb = null; protected DOMFile domDb = null; protected NativeElementIndex elementIndex; - protected ElementPool elementPool = new ElementPool(50); protected BFile elementsDb = null; protected NativeTextEngine textEngine; protected Serializer xmlSerializer; protected PatternCompiler compiler = new Perl5Compiler(); protected PatternMatcher matcher = new Perl5Matcher(); protected int defaultIndexDepth = 1; protected Map idxPathMap; protected boolean readOnly = false; protected int memMinFree; protected int nodesCount = 0; private final Runtime run = Runtime.getRuntime(); --- 117,142 ---- protected final static int MEM_LIMIT_CHECK = 10000; + // the database files protected CollectionStore collectionsDb = null; protected DOMFile domDb = null; protected NativeElementIndex elementIndex; protected BFile elementsDb = null; + protected NativeTextEngine textEngine; protected Serializer xmlSerializer; + protected PatternCompiler compiler = new Perl5Compiler(); protected PatternMatcher matcher = new Perl5Matcher(); + protected int defaultIndexDepth = 1; protected Map idxPathMap; + protected boolean readOnly = false; + protected int memMinFree; + + // used to count the nodes inserted after the last memory check protected int nodesCount = 0; + private final Runtime run = Runtime.getRuntime(); *************** *** 154,157 **** --- 163,167 ---- if ((memMinFree = config.getInteger("db-connection.min_free_memory")) < 0) memMinFree = 5000000; + Paged.setPageSize(pageSize); String pathSep = System.getProperty("file.separator", "/"); *************** *** 242,245 **** --- 252,256 ---- if (readOnly) LOG.info("database runs in read-only mode"); + idxPathMap = (Map) config.getProperty("indexer.map"); textEngine = new NativeTextEngine(this, config, buffers); *************** *** 383,387 **** public NodeSet findElementsByTagName(byte type, DocumentSet docs, QName qname, NodeSelector selector) { ! // final long start = System.currentTimeMillis(); final ExtArrayNodeSet result = new ExtArrayNodeSet(docs.getLength(), 256); DocumentImpl doc; --- 394,398 ---- public NodeSet findElementsByTagName(byte type, DocumentSet docs, QName qname, NodeSelector selector) { ! final long start = System.currentTimeMillis(); final ExtArrayNodeSet result = new ExtArrayNodeSet(docs.getLength(), 256); DocumentImpl doc; *************** *** 614,618 **** domDb.setOwnerObject(this); try { ! return new NodeIterator(this, domDb, proxy, true); } catch (BTreeException e) { LOG.debug("failed to create node iterator", e); --- 625,629 ---- domDb.setOwnerObject(this); try { ! return new NodeIterator(this, domDb, proxy, false); } catch (BTreeException e) { LOG.debug("failed to create node iterator", e); *************** *** 988,992 **** for (Iterator i = nodes.iterator(); i.hasNext();) { ref = (Value) i.next(); ! gid = ByteConversion.byteToLong(ref.data(), 4); if (oldDoc.getTreeLevel(gid) >= doc.reindexRequired()) { if (node != null) { --- 999,1003 ---- for (Iterator i = nodes.iterator(); i.hasNext();) { ref = (Value) i.next(); ! gid = ByteConversion.byteToLong(ref.data(), ref.start() + 4); if (oldDoc.getTreeLevel(gid) >= doc.reindexRequired()) { if (node != null) { *************** *** 1020,1024 **** new NodeProxy(doc, n.getGID(), n.getInternalAddress())); iterator.next(); ! scanNodes(iterator, n, new StringBuffer()); } } else { --- 1031,1035 ---- new NodeProxy(doc, n.getGID(), n.getInternalAddress())); iterator.next(); ! scanNodes(iterator, n, new NodePath()); } } else { *************** *** 1042,1046 **** * @param currentPath */ ! private void reindex(final NodeImpl node, StringBuffer currentPath) { if (node.getGID() < 0) LOG.debug("illegal node: " + node.getGID() + "; " + node.getNodeName()); --- 1053,1057 ---- * @param currentPath */ ! private void reindex(final NodeImpl node, NodePath currentPath) { if (node.getGID() < 0) LOG.debug("illegal node: " + node.getGID() + "; " + node.getNodeName()); *************** *** 1049,1055 **** final short nodeType = node.getNodeType(); final long gid = node.getGID(); - final String nodeName = node.getNodeName(); final DocumentImpl doc = (DocumentImpl) node.getOwnerDocument(); - final byte data[] = node.serialize(); final int depth = idx == null ? defaultIndexDepth : idx.getIndexDepth(); final int level = doc.getTreeLevel(gid); --- 1060,1064 ---- *************** *** 1085,1089 **** qname.setNameType(ElementValue.ELEMENT); tempProxy.setHasIndex( ! idx == null || idx.match(currentPath.toString())); elementIndex.setDocument(doc); elementIndex.addRow(qname, tempProxy); --- 1094,1098 ---- qname.setNameType(ElementValue.ELEMENT); tempProxy.setHasIndex( ! idx == null || idx.match(currentPath)); elementIndex.setDocument(doc); elementIndex.addRow(qname, tempProxy); *************** *** 1091,1095 **** case Node.ATTRIBUTE_NODE : tempProxy.setHasIndex( ! idx == null || idx.match(currentPath.toString())); elementIndex.setDocument(doc); qname = --- 1100,1104 ---- case Node.ATTRIBUTE_NODE : tempProxy.setHasIndex( ! idx == null || idx.match(currentPath)); elementIndex.setDocument(doc); qname = *************** *** 1102,1108 **** // check if attribute value should be fulltext-indexed // by calling IndexPaths.match(path) ! if (idx == null ! || (idx.getIncludeAttributes() ! && idx.match(currentPath + "/@" + nodeName))) textEngine.storeAttribute(idx, (AttrImpl) node); // if the attribute has type ID, store the ID-value --- 1111,1124 ---- // check if attribute value should be fulltext-indexed // by calling IndexPaths.match(path) ! boolean indexAttribs = true; ! if(idx != null) { ! if(idx.getIncludeAttributes()) { ! currentPath.addComponent('@' + ((AttrImpl)node).getName()); ! indexAttribs = idx.match(currentPath); ! currentPath.removeLastComponent(); ! } else ! indexAttribs = false; ! } ! if (indexAttribs) textEngine.storeAttribute(idx, (AttrImpl) node); // if the attribute has type ID, store the ID-value *************** *** 1117,1121 **** // check if this textual content should be fulltext-indexed // by calling IndexPaths.match(path) ! if (idx == null || idx.match(currentPath.toString())) textEngine.storeText(idx, (TextImpl) node); break; --- 1133,1137 ---- // check if this textual content should be fulltext-indexed // by calling IndexPaths.match(path) ! if (idx == null || idx.match(currentPath)) textEngine.storeText(idx, (TextImpl) node); break; *************** *** 1132,1138 **** * @param currentPath */ ! private void scanNodes(Iterator iterator, NodeImpl node, StringBuffer currentPath) { if (node.getNodeType() == Node.ELEMENT_NODE) ! currentPath.append('/').append(node.getNodeName()); reindex(node, currentPath); if (node.hasChildNodes()) { --- 1148,1154 ---- * @param currentPath */ ! private void scanNodes(Iterator iterator, NodeImpl node, NodePath currentPath) { if (node.getNodeType() == Node.ELEMENT_NODE) ! currentPath.addComponent(node.getNodeName()); reindex(node, currentPath); if (node.hasChildNodes()) { *************** *** 1160,1163 **** --- 1176,1181 ---- } } + if(node.getNodeType() == Node.ELEMENT_NODE) + currentPath.removeLastComponent(); } *************** *** 1438,1442 **** lock.release(); } - elementPool.clear(); LOG.debug("removing dom nodes ..."); --- 1456,1459 ---- *************** *** 1597,1601 **** lock.release(); } - elementPool.clear(); ((NativeTextEngine) textEngine).removeDocument(doc); --- 1614,1617 ---- *************** *** 1925,1929 **** * fulltext-indexed). */ ! public void store(final NodeImpl node, CharSequence currentPath) { // first, check available memory if (nodesCount > MEM_LIMIT_CHECK) { --- 1941,1945 ---- * fulltext-indexed). */ ! public void store(final NodeImpl node, NodePath currentPath) { // first, check available memory if (nodesCount > MEM_LIMIT_CHECK) { *************** *** 1993,1999 **** // check if attribute value should be fulltext-indexed // by calling IndexPaths.match(path) ! if (idx == null ! || (idx.getIncludeAttributes() ! && idx.match(currentPath + "/@" + nodeName))) textEngine.storeAttribute(idx, (AttrImpl) node); // if the attribute has type ID, store the ID-value --- 2009,2022 ---- // check if attribute value should be fulltext-indexed // by calling IndexPaths.match(path) ! boolean indexAttribs = true; ! if(idx != null) { ! if(idx.getIncludeAttributes()) { ! currentPath.addComponent('@' + nodeName); ! indexAttribs = idx.match(currentPath); ! currentPath.removeLastComponent(); ! } else ! indexAttribs = false; ! } ! if(indexAttribs) textEngine.storeAttribute(idx, (AttrImpl) node); // if the attribute has type ID, store the ID-value Index: NativeElementIndex.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeElementIndex.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** NativeElementIndex.java 3 May 2004 13:08:43 -0000 1.24 --- NativeElementIndex.java 10 May 2004 11:22:41 -0000 1.25 *************** *** 28,32 **** import java.util.Map; ! import org.apache.log4j.Category; import org.dbxml.core.DBException; import org.dbxml.core.data.Value; --- 28,32 ---- import java.util.Map; ! import org.apache.log4j.Logger; import org.dbxml.core.DBException; import org.dbxml.core.data.Value; *************** *** 47,59 **** import org.exist.util.ProgressIndicator; import org.exist.util.ReadOnlyException; - //import org.exist.util.StorageAddress; public class NativeElementIndex extends ElementIndex { ! private static Category LOG = Category.getInstance(NativeElementIndex.class .getName()); - public final static int PARTITION_SIZE = 102400; - protected BFile dbElement; private VariableByteOutputStream os = new VariableByteOutputStream(); --- 47,56 ---- import org.exist.util.ProgressIndicator; import org.exist.util.ReadOnlyException; public class NativeElementIndex extends ElementIndex { ! private static Logger LOG = Logger.getLogger(NativeElementIndex.class .getName()); protected BFile dbElement; private VariableByteOutputStream os = new VariableByteOutputStream(); *************** *** 361,365 **** prevId = proxy.gid; os.writeLong(cid); - //os.writeFixedLong(proxy.getInternalAddress()); StorageAddress.write(proxy.getInternalAddress(), os); } --- 358,361 ---- Index: DBBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/DBBroker.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** DBBroker.java 3 May 2004 13:08:43 -0000 1.25 --- DBBroker.java 10 May 2004 11:22:41 -0000 1.26 *************** *** 60,64 **** * *@author Wolfgang Meier <wol...@ex...> - *@created 20. Mai 2002 */ public abstract class DBBroker extends Observable { --- 60,63 ---- *************** *** 80,90 **** --- 79,94 ---- protected Configuration config; + protected BrokerPool pool; + protected File symbolsFile; protected SymbolTable symbols = null; + protected User user = null; private int referenceCount = 0; + protected int xupdateGrowthFactor = 1; + protected void saveSymbols() throws EXistException { synchronized (symbols) { *************** *** 148,151 **** --- 152,157 ---- config.setProperty("db-connection.symbol-table", symbols); } + if ((xupdateGrowthFactor = config.getInteger("xupdate.growth-factor")) < 0) + xupdateGrowthFactor = 1; this.pool = pool; } *************** *** 479,483 **** * fulltext-indexed). */ ! public abstract void store(NodeImpl node, CharSequence currentPath); /** --- 485,489 ---- * fulltext-indexed). */ ! public abstract void store(NodeImpl node, NodePath currentPath); /** *************** *** 575,577 **** --- 581,587 ---- --referenceCount; } + + public int getXUpdateGrowthFactor() { + return xupdateGrowthFactor; + } } \ No newline at end of file Index: IndexPaths.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/IndexPaths.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IndexPaths.java 25 Nov 2003 12:54:15 -0000 1.6 --- IndexPaths.java 10 May 2004 11:22:41 -0000 1.7 *************** *** 1,5 **** /* * eXist Open Source Native XML Database ! * Copyright (C) 2001, Wolfgang Meier * * This program is free software; you can redistribute it and/or --- 1,5 ---- /* * eXist Open Source Native XML Database ! * Copyright (C) 2001-04, Wolfgang Meier * * This program is free software; you can redistribute it and/or *************** *** 17,21 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ! * $Id: */ package org.exist.storage; --- 17,21 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ! * $Id$ */ package org.exist.storage; *************** *** 25,31 **** import java.util.Iterator; - import org.exist.util.FastStringBuffer; - import org.exist.util.MutableStringTokenizer; - /** --- 25,28 ---- *************** *** 42,55 **** private final static HashMap cache = new HashMap(); - private final static int MAX_CACHE_SIZE = 64; protected ArrayList includePath; protected ArrayList excludePath; protected boolean includeByDefault = true; protected boolean includeAttributes = true; protected boolean includeAlphaNum = true; protected int depth = 1; - protected MutableStringTokenizer tokenizer = new MutableStringTokenizer(); - private FastStringBuffer token = new FastStringBuffer(); /** --- 39,51 ---- private final static HashMap cache = new HashMap(); protected ArrayList includePath; protected ArrayList excludePath; + protected boolean includeByDefault = true; protected boolean includeAttributes = true; protected boolean includeAlphaNum = true; + protected int depth = 1; /** *************** *** 71,78 **** */ public void addInclude( String path ) { ! ArrayList a = tokenize( path ); ! String arr[] = new String[a.size()]; ! arr = (String[])a.toArray(arr); ! includePath.add( arr ); } --- 67,71 ---- */ public void addInclude( String path ) { ! includePath.add( new NodePath(path) ); } *************** *** 83,90 **** */ public void addExclude( String path ) { ! ArrayList a = tokenize( path ); ! String arr[] = new String[a.size()]; ! arr = (String[])a.toArray(arr); ! excludePath.add( arr ); } --- 76,80 ---- */ public void addExclude( String path ) { ! excludePath.add( new NodePath(path) ); } *************** *** 153,230 **** * @return Description of the Return Value */ ! public boolean match( CharSequence path ) { if ( includeByDefault ) { // check exclusions for ( Iterator i = excludePath.iterator(); i.hasNext( ); ) ! if ( match( (String[]) i.next( ), path ) ) return false; ! return true; } for ( Iterator i = includePath.iterator(); i.hasNext(); ) ! if ( match( (String[]) i.next(), path ) ) return true; return false; } - - private final boolean match( String[] path, CharSequence other) { - int i = 0; - boolean skip = false; - tokenizer.set(other, "/"); - CharSequence next; - while((next = tokenizer.nextToken()) != null) { - if(i == path.length) - return true; - if(path[i].equals("*")) { - ++i; - skip = true; - } - if(next.equals(path[i])) { - ++i; - skip = false; - } else if(skip) { - continue; - } else - return false; - } - return i == path.length; - } - - /** - * Description of the Method - * - * @param path Description of the Parameter - * - * @return Description of the Return Value - */ - private final ArrayList tokenize( String path ) { - ArrayList temp = new ArrayList(); - String next; - token.reset(); - int pos = 0; - char ch = 0; - final int pathLen = path.length(); - while ( pos < pathLen ) { - ch = path.charAt(pos); - switch ( ch ) { - case '/': - next = token.toString(); - token.reset(); - if ( next.length( ) > 0 ) - temp.add( next ); - if ( path.charAt( ++pos ) == '/' ) - temp.add( "*" ); - break; - - default: - token.append(ch); - pos++; - } - } - if ( token.length() > 0 ) - temp.add( token.toString() ); - return temp; - } } --- 143,161 ---- * @return Description of the Return Value */ ! public boolean match( NodePath path ) { if ( includeByDefault ) { // check exclusions for ( Iterator i = excludePath.iterator(); i.hasNext( ); ) ! if( ((NodePath)i.next()).match(path) ) return false; ! return true; } for ( Iterator i = includePath.iterator(); i.hasNext(); ) ! if( ((NodePath)i.next()).match(path) ) return true; return false; } } |
From: Wolfgang M. M. <wol...@us...> - 2004-05-10 11:23:23
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/store In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25553/src/org/exist/storage/store Modified Files: BFile.java NodeIterator.java DOMFile.java Log Message: XUpdate: * Btree not correctly updated after node changes, leading to NullPointerException * Attribute values truncated * Page splitting error results in NullPointerException after a few hundred XUpdates * New configuration parameter to control XUpdate behaviour Other: * Properties passed to Collection, XPathQueryService, XQueryService had no effect. * Modified evaluation of index settings in conf.xml. Index: DOMFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/DOMFile.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** DOMFile.java 3 May 2004 13:08:45 -0000 1.24 --- DOMFile.java 10 May 2004 11:22:42 -0000 1.25 *************** *** 459,463 **** backLink = StorageAddress.createPointer( (int) rec.page.getPageNum(), tid); - // LOG.debug("Writing " + ItemId.getId(currentId) + " to " + nextSplitPage.getPageNum()); // set the relocated flag and save the item id ByteConversion.shortToByte(ItemId.setIsRelocated(currentId), --- 459,462 ---- *************** *** 519,543 **** } } ! nextSplitPage.getPageHeader().setDataLength(nextSplitPage.len); ! nextSplitPage.getPageHeader().setNextDataPage( ! rec.page.getPageHeader().getNextDataPage()); ! nextSplitPage.getPageHeader().setRecordCount(splitRecordCount); ! nextSplitPage.setDirty(true); ! dataCache.add(nextSplitPage); ! firstSplitPage.getPageHeader().setPrevDataPage(rec.page.getPageNum()); ! if(nextSplitPage != firstSplitPage) { ! firstSplitPage.setDirty(true); ! dataCache.add(firstSplitPage); ! } ! long next = nextSplitPage.getPageHeader().getNextDataPage(); ! if (-1 < next) { ! DOMPage nextPage = getCurrentPage(nextSplitPage.getPageHeader() ! .getNextDataPage()); ! nextPage.getPageHeader() ! .setPrevDataPage(nextSplitPage.getPageNum()); ! nextPage.setDirty(true); ! dataCache.add(nextPage); } ! rec.page.getPageHeader().setNextDataPage(firstSplitPage.getPageNum()); rec.page.getPageHeader().setDataLength(rec.page.len); rec.page.getPageHeader().setRecordCount(countRecordsInPage(rec.page)); --- 518,557 ---- } } ! if(nextSplitPage.len == 0) { ! // if nothing has been copied to the last split page, ! // remove it ! dataCache.remove(nextSplitPage); ! if(nextSplitPage == firstSplitPage) ! firstSplitPage = null; ! try { ! unlinkPages(nextSplitPage.page); ! } catch (IOException e) { ! LOG.warn("Failed to remove empty split page: " + e.getMessage(), e); ! } ! nextSplitPage = null; ! } else { ! nextSplitPage.getPageHeader().setDataLength(nextSplitPage.len); ! nextSplitPage.getPageHeader().setNextDataPage( ! rec.page.getPageHeader().getNextDataPage()); ! nextSplitPage.getPageHeader().setRecordCount(splitRecordCount); ! nextSplitPage.setDirty(true); ! dataCache.add(nextSplitPage); ! firstSplitPage.getPageHeader().setPrevDataPage(rec.page.getPageNum()); ! if(nextSplitPage != firstSplitPage) { ! firstSplitPage.setDirty(true); ! dataCache.add(firstSplitPage); ! } ! long next = nextSplitPage.getPageHeader().getNextDataPage(); ! if (-1 < next) { ! DOMPage nextPage = getCurrentPage(nextSplitPage.getPageHeader() ! .getNextDataPage()); ! nextPage.getPageHeader() ! .setPrevDataPage(nextSplitPage.getPageNum()); ! nextPage.setDirty(true); ! dataCache.add(nextPage); ! } } ! if(firstSplitPage != null) ! rec.page.getPageHeader().setNextDataPage(firstSplitPage.getPageNum()); rec.page.getPageHeader().setDataLength(rec.page.len); rec.page.getPageHeader().setRecordCount(countRecordsInPage(rec.page)); *************** *** 709,712 **** --- 723,727 ---- if (id < 1) { LOG.warn(node.gid + " not found."); + Thread.dumpStack(); throw new BTreeException("node " + node.gid + " not found."); } Index: NodeIterator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/NodeIterator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NodeIterator.java 27 Apr 2004 15:46:57 -0000 1.7 --- NodeIterator.java 10 May 2004 11:22:42 -0000 1.8 *************** *** 112,115 **** --- 112,116 ---- } if(gotoNextPosition()) { + boolean skipped = false; do { DOMFile.DOMFilePageHeader ph = p.getPageHeader(); *************** *** 136,141 **** long link = ByteConversion.byteToLong(p.data, offset); offset += 8; ! //System.out.println("skipping link on p " + page + " -> " + ! // StorageAddress.pageFromPointer(link)); continue; } --- 137,143 ---- long link = ByteConversion.byteToLong(p.data, offset); offset += 8; ! // System.out.println("skipping link on p " + page + " -> " + ! // StorageAddress.pageFromPointer(link)); ! skipped = true; continue; } *************** *** 149,152 **** --- 151,156 ---- // overflow page? load the overflow value if(l == DOMFile.OVERFLOW) { + LOG.warn("unexpected overflow page at " + p.getPageNum() + "; tid = " + + ItemId.getId(lastTID) + "; offset = " + offset + "; skipped = " + skipped); l = 8; final long overflow = ByteConversion.byteToLong(p.data, offset); Index: BFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/store/BFile.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** BFile.java 3 May 2004 13:08:45 -0000 1.20 --- BFile.java 10 May 2004 11:22:41 -0000 1.21 *************** *** 657,661 **** fileHeader.removeFreeSpace(free); } ! fileHeader.addFreeSpace(free); } dataCache.add(page, 2); --- 657,662 ---- fileHeader.removeFreeSpace(free); } ! if(page.getPageHeader().getCurrentTID() > -1) ! fileHeader.addFreeSpace(free); } dataCache.add(page, 2); *************** *** 712,716 **** LOG.warn("page " + page.getPageNum() + " is not a data page; removing it"); - fileHeader.printFreeSpace(); fileHeader.removeFreeSpace(free); continue; --- 713,716 ---- *************** *** 891,895 **** public String toString() { ! return Integer.toString(free); } } --- 891,895 ---- public String toString() { ! return "page: " + page + ": " + free; } } *************** *** 1051,1054 **** --- 1051,1061 ---- } + public short getCurrentTID() { + if(nextTID == Short.MAX_VALUE) { + return -1; + } + return nextTID; + } + public short getRecordCount() { return records; *************** *** 1681,1693 **** public final void skip(int count) throws IOException { - byte b; for (int i = 0; i < count; i++) { do { if (offset == pageLen) advance(); ! b = nextPage.data[offset++]; ! } while ((b & 0200) > 0); } } private final void advance() throws IOException { long next = nextPage.getPageHeader().getNextInChain(); --- 1688,1704 ---- public final void skip(int count) throws IOException { for (int i = 0; i < count; i++) { do { if (offset == pageLen) advance(); ! } while ((nextPage.data[offset++] & 0200) > 0); } } + public final void skipBytes(long count) throws IOException { + for(long i = 0; i < count; i++) { + if(offset++ == pageLen) advance(); + } + } + private final void advance() throws IOException { long next = nextPage.getPageHeader().getNextInChain(); |
From: Wolfgang M. M. <wol...@us...> - 2004-05-10 11:23:23
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25553/src/org/exist/xquery Modified Files: XQueryContext.java Log Message: XUpdate: * Btree not correctly updated after node changes, leading to NullPointerException * Attribute values truncated * Page splitting error results in NullPointerException after a few hundred XUpdates * New configuration parameter to control XUpdate behaviour Other: * Properties passed to Collection, XPathQueryService, XQueryService had no effect. * Modified evaluation of index settings in conf.xml. Index: XQueryContext.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/XQueryContext.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** XQueryContext.java 5 May 2004 18:05:41 -0000 1.13 --- XQueryContext.java 10 May 2004 11:22:43 -0000 1.14 *************** *** 382,386 **** //LOG.debug("module " + module.getNamespaceURI() + " loaded successfully."); } catch (ClassNotFoundException e) { ! LOG.warn("module class " + moduleClass + " not found. Skipping..."); } catch (InstantiationException e) { LOG.warn("error while instantiating module class " + moduleClass, e); --- 382,386 ---- //LOG.debug("module " + module.getNamespaceURI() + " loaded successfully."); } catch (ClassNotFoundException e) { ! //LOG.warn("module class " + moduleClass + " not found. Skipping..."); } catch (InstantiationException e) { LOG.warn("error while instantiating module class " + moduleClass, e); |