From: Wolfgang M. M. <wol...@us...> - 2004-08-10 20:28:02
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24902/src/org/exist/storage Modified Files: NativeTextEngine.java BrokerPool.java Log Message: Refactored some methods to improve performance during storage and indexing. Index: NativeTextEngine.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeTextEngine.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** NativeTextEngine.java 4 Aug 2004 21:19:32 -0000 1.66 --- NativeTextEngine.java 10 Aug 2004 20:27:14 -0000 1.67 *************** *** 1164,1167 **** --- 1164,1168 ---- words[k].clear(); } + // dbWords.debugFreeList(); } Index: BrokerPool.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/BrokerPool.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** BrokerPool.java 4 Aug 2004 14:48:06 -0000 1.27 --- BrokerPool.java 10 Aug 2004 20:27:14 -0000 1.28 *************** *** 38,45 **** import org.exist.util.Lock; import org.exist.util.ReentrantReadWriteLock; import org.exist.xmldb.ShutdownListener; /** ! * This class controls all available instances of the database. * Use it to configure, start and stop database instances. You may * have multiple instances defined, each using its own configuration, --- 38,47 ---- import org.exist.util.Lock; import org.exist.util.ReentrantReadWriteLock; + import org.exist.util.XMLReaderObjectFactory; + import org.exist.util.XMLReaderPool; import org.exist.xmldb.ShutdownListener; /** ! * This class controls all available instances of the database. * Use it to configure, start and stop database instances. You may * have multiple instances defined, each using its own configuration, *************** *** 175,183 **** --- 177,210 ---- private boolean initializing = true; + /** + * The security manager for this database instance. + */ private org.exist.security.SecurityManager secManager = null; + + /** + * SyncDaemon is a daemon thread which periodically triggers a cache sync. + */ private SyncDaemon syncDaemon; + + /** + * ShutdownListener will be notified when the database instance shuts down. + */ private ShutdownListener shutdownListener = null; + + /** + * The global pool for compiled XQuery expressions. + */ private XQueryPool xqueryCache; + + /** + * The global collection cache. + */ protected CollectionCache collectionsCache; + + /** + * Global pool for SAX XMLReader instances. + */ + protected XMLReaderPool xmlReaderPool; + private Lock globalXUpdateLock = new ReentrantReadWriteLock("xupdate"); *************** *** 209,212 **** --- 236,240 ---- xqueryCache = new XQueryPool(); collectionsCache = new CollectionCache(COLLECTION_BUFFER_SIZE); + xmlReaderPool = new XMLReaderPool(new XMLReaderObjectFactory(this), 5, 0); initialize(); } *************** *** 236,243 **** --- 264,281 ---- } + /** + * Returns the global collections cache. Collection objects + * are shared within one database instance. + * + * @return + */ public CollectionCache getCollectionsCache() { return collectionsCache; } + public XMLReaderPool getParserPool() { + return xmlReaderPool; + } + protected DBBroker createBroker() throws EXistException { DBBroker broker = BrokerFactory.getInstance(this, conf); *************** *** 389,395 **** public synchronized void shutdown(boolean killed) { syncDaemon.shutDown(); ! while (pool.size() < brokers) try { ! this.wait(); } catch (InterruptedException e) { } --- 427,433 ---- public synchronized void shutdown(boolean killed) { syncDaemon.shutDown(); ! while (threads.size() > 0) try { ! this.wait(2000); } catch (InterruptedException e) { } |