org.intermine.objectstore.fastcollections
Class ObjectStoreFastCollectionsImpl

java.lang.Object
  extended by org.intermine.objectstore.ObjectStorePassthruImpl
      extended by org.intermine.objectstore.fastcollections.ObjectStoreFastCollectionsImpl
All Implemented Interfaces:
ObjectStore

public class ObjectStoreFastCollectionsImpl
extends ObjectStorePassthruImpl

Provides an implementation of an objectstore that explicitly materialises all the collections in the results set it provides.


Field Summary
 
Fields inherited from class org.intermine.objectstore.ObjectStorePassthruImpl
os
 
Fields inherited from interface org.intermine.objectstore.ObjectStore
SEQUENCE_IGNORE
 
Constructor Summary
ObjectStoreFastCollectionsImpl(ObjectStore os)
          Creates an instance, from another ObjectStore instance.
 
Method Summary
 Results execute(Query q)
          Execute a Query on this ObjectStore
 Results execute(Query q, int batchSize, boolean optimise, boolean explain, boolean prefetch)
          Execute a Query on this ObjectStore
 java.util.List<ResultsRow<java.lang.Object>> execute(Query q, int start, int limit, boolean optimise, boolean explain, java.util.Map<java.lang.Object,java.lang.Integer> sequence)
          Execute a Query on this ObjectStore, asking for a certain range of rows to be returned.
 SingletonResults executeSingleton(Query q)
          Execute a Query on this ObjectStore, returning a SingletonResults
 SingletonResults executeSingleton(Query q, int batchSize, boolean optimise, boolean explain, boolean prefetch)
          Execute a Query on this ObjectStore, returning a SingletonResults
static ObjectStoreFastCollectionsImpl getInstance(java.lang.String osAlias, java.util.Properties props)
          Gets an ObjectStoreFastCollectionsImpl instance for the given properties
 void setFetchFields(boolean fetchAllFields, java.util.Set<FieldDescriptor> fieldExceptions)
          Sets variables which determines which fields are prefetched.
 java.lang.String toString()
          
 
Methods inherited from class org.intermine.objectstore.ObjectStorePassthruImpl
cacheObjectById, count, createClob, createObjectStoreBag, estimate, flushObjectById, getComponentsForQuery, getMaxLimit, getMaxOffset, getMaxTime, getModel, getNewWriter, getObjectByExample, getObjectById, getObjectById, getObjectsByIds, getSequence, getSerial, invalidateObjectById, isMultiConnection, pilferObjectById, prefetchObjectById
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectStoreFastCollectionsImpl

public ObjectStoreFastCollectionsImpl(ObjectStore os)
Creates an instance, from another ObjectStore instance.

Parameters:
os - an ObjectStore object to use
Method Detail

getInstance

public static ObjectStoreFastCollectionsImpl getInstance(java.lang.String osAlias,
                                                         java.util.Properties props)
                                                  throws ObjectStoreException
Gets an ObjectStoreFastCollectionsImpl instance for the given properties

Parameters:
osAlias - the alias of this objectstore
props - the properties
Returns:
the ObjectStore
Throws:
java.lang.IllegalArgumentException - if props are invalid
ObjectStoreException - if there is a problem with the instance

setFetchFields

public void setFetchFields(boolean fetchAllFields,
                           java.util.Set<FieldDescriptor> fieldExceptions)
Sets variables which determines which fields are prefetched. Set fetchAllFields to true if you want all fields except those mentioned in the fieldExceptions set to be fetched. Set fetchAllFields to false if you only want those fields mentioned in the fieldExceptions set to be fetched.

Parameters:
fetchAllFields - a boolean
fieldExceptions - a Set of FieldDescriptors

execute

public Results execute(Query q)
Execute a Query on this ObjectStore

Specified by:
execute in interface ObjectStore
Overrides:
execute in class ObjectStorePassthruImpl
Parameters:
q - the Query to execute
Returns:
the results of the Query

execute

public Results execute(Query q,
                       int batchSize,
                       boolean optimise,
                       boolean explain,
                       boolean prefetch)
Execute a Query on this ObjectStore

Specified by:
execute in interface ObjectStore
Overrides:
execute in class ObjectStorePassthruImpl
Parameters:
q - the Query to execute
batchSize - the batch size to initialise the Results object with
optimise - whether to optimise queries
explain - whether to explain queries
prefetch - whether to use the PrefetchManager
Returns:
the results of the Query

executeSingleton

public SingletonResults executeSingleton(Query q)
Execute a Query on this ObjectStore, returning a SingletonResults

Specified by:
executeSingleton in interface ObjectStore
Overrides:
executeSingleton in class ObjectStorePassthruImpl
Parameters:
q - the Query to execute
Returns:
the results of the Query

executeSingleton

public SingletonResults executeSingleton(Query q,
                                         int batchSize,
                                         boolean optimise,
                                         boolean explain,
                                         boolean prefetch)
Execute a Query on this ObjectStore, returning a SingletonResults

Specified by:
executeSingleton in interface ObjectStore
Overrides:
executeSingleton in class ObjectStorePassthruImpl
Parameters:
q - the Query to execute
batchSize - the batch size to initialise the Results object with
optimise - whether to optimise queries
explain - whether to explain queries
prefetch - whether to use the PrefetchManager
Returns:
the results of the Query

execute

public java.util.List<ResultsRow<java.lang.Object>> execute(Query q,
                                                            int start,
                                                            int limit,
                                                            boolean optimise,
                                                            boolean explain,
                                                            java.util.Map<java.lang.Object,java.lang.Integer> sequence)
                                                     throws ObjectStoreException
Execute a Query on this ObjectStore, asking for a certain range of rows to be returned. This will usually only be called by the Results object returned from execute(Query q).

Specified by:
execute in interface ObjectStore
Overrides:
execute in class ObjectStorePassthruImpl
Parameters:
q - the Query to execute
start - the start row
limit - the maximum number of rows to return
optimise - true if it is expected that optimising the query will improve performance
explain - true if the ObjectStore should enforce maximum query running time constraints
sequence - an object representing the state of the database corresponding to when the action that resulted in this execute was started. This number must match the ObjectStore's internal sequence number or a DataChangedException is thrown. The sequence number is incremented each time the data in the objectstore is changed
Returns:
a List of ResultRows
Throws:
ObjectStoreException - if an error occurs during the running of the Query

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object