org.exist.storage
Class XQueryPool

java.lang.Object
  extended by org.exist.util.hashtable.AbstractHashtable
      extended by org.exist.util.hashtable.Object2ObjectHashMap
          extended by org.exist.storage.XQueryPool

public class XQueryPool
extends Object2ObjectHashMap

Global pool for pre-compiled XQuery expressions. Expressions are stored and retrieved from the pool by comparing the Source objects from which they were created. For each XQuery, a maximum of MAX_STACK_SIZE compiled expressions are kept in the pool. An XQuery expression will be removed from the pool if it has not been used for a pre-defined timeout. These settings can be configured in conf.xml.

Author:
wolf

Field Summary
static String CONFIGURATION_ELEMENT_NAME
           
static int MAX_POOL_SIZE
           
static int MAX_STACK_SIZE
           
static String MAX_STACK_SIZE_ATTRIBUTE
           
static String POOL_SIZE_ATTTRIBUTE
           
static String PROPERTY_MAX_STACK_SIZE
           
static String PROPERTY_POOL_SIZE
           
static String PROPERTY_TIMEOUT
           
static String PROPERTY_TIMEOUT_CHECK_INTERVAL
           
static long TIMEOUT
           
static String TIMEOUT_ATTRIBUTE
           
static long TIMEOUT_CHECK_INTERVAL
           
static String TIMEOUT_CHECK_INTERVAL_ATTRIBUTE
           
 
Constructor Summary
XQueryPool(Configuration conf)
           
 
Method Summary
 CompiledXQuery borrowCompiledXQuery(DBBroker broker, Source source)
           
 ExternalModule borrowModule(DBBroker broker, Source source, XQueryContext rootContext)
           
 void returnCompiledXQuery(Source source, CompiledXQuery xquery)
           
 
Methods inherited from class org.exist.util.hashtable.Object2ObjectHashMap
get, getIndex, iterator, put, remove, valueIterator
 
Methods inherited from class org.exist.util.hashtable.AbstractHashtable
getMaxRehash, isPrime, nextPrime, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_POOL_SIZE

public static final int MAX_POOL_SIZE
See Also:
Constant Field Values

MAX_STACK_SIZE

public static final int MAX_STACK_SIZE
See Also:
Constant Field Values

TIMEOUT

public static final long TIMEOUT
See Also:
Constant Field Values

TIMEOUT_CHECK_INTERVAL

public static final long TIMEOUT_CHECK_INTERVAL
See Also:
Constant Field Values

CONFIGURATION_ELEMENT_NAME

public static final String CONFIGURATION_ELEMENT_NAME
See Also:
Constant Field Values

MAX_STACK_SIZE_ATTRIBUTE

public static final String MAX_STACK_SIZE_ATTRIBUTE
See Also:
Constant Field Values

POOL_SIZE_ATTTRIBUTE

public static final String POOL_SIZE_ATTTRIBUTE
See Also:
Constant Field Values

TIMEOUT_ATTRIBUTE

public static final String TIMEOUT_ATTRIBUTE
See Also:
Constant Field Values

TIMEOUT_CHECK_INTERVAL_ATTRIBUTE

public static final String TIMEOUT_CHECK_INTERVAL_ATTRIBUTE
See Also:
Constant Field Values

PROPERTY_MAX_STACK_SIZE

public static final String PROPERTY_MAX_STACK_SIZE
See Also:
Constant Field Values

PROPERTY_POOL_SIZE

public static final String PROPERTY_POOL_SIZE
See Also:
Constant Field Values

PROPERTY_TIMEOUT

public static final String PROPERTY_TIMEOUT
See Also:
Constant Field Values

PROPERTY_TIMEOUT_CHECK_INTERVAL

public static final String PROPERTY_TIMEOUT_CHECK_INTERVAL
See Also:
Constant Field Values
Constructor Detail

XQueryPool

public XQueryPool(Configuration conf)
Parameters:
conf -
Method Detail

returnCompiledXQuery

public void returnCompiledXQuery(Source source,
                                 CompiledXQuery xquery)

borrowCompiledXQuery

public CompiledXQuery borrowCompiledXQuery(DBBroker broker,
                                           Source source)

borrowModule

public ExternalModule borrowModule(DBBroker broker,
                                   Source source,
                                   XQueryContext rootContext)


Copyright (C) Wolfgang Meier. All rights reserved.