|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ObjectStore
Gets the Results of a Query from an underlying store.
| Field Summary | |
|---|---|
static java.util.Map<java.lang.Object,java.lang.Integer> |
SEQUENCE_IGNORE
Object representing no fail-fast concurrency checks required. |
| Method Summary | |
|---|---|
java.lang.Object |
cacheObjectById(java.lang.Integer id,
InterMineObject obj)
Places an entry into the objectstore getObjectById cache. |
int |
count(Query q,
java.util.Map<java.lang.Object,java.lang.Integer> sequence)
Counts the number of rows the query will produce |
Clob |
createClob()
Creates a new empty Clob that is valid for this ObjectStore. |
ObjectStoreBag |
createObjectStoreBag()
Returns a new empty ObjectStoreBag object that is valid for this ObjectStore. |
ResultsInfo |
estimate(Query q)
Explain a Query (give estimate for execution time and number of rows). |
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 |
void |
flushObjectById()
Completely empties the getObjectById cache. |
java.util.Set<java.lang.Object> |
getComponentsForQuery(Query q)
Returns a Set of independent components that affect the results of the given Query. |
int |
getMaxLimit()
Get the maximum LIMIT that can be used in an SQL query without throwing an ObjectStoreLimitReachedException |
int |
getMaxOffset()
Get the maximum range start index a that can be accessed in a Results object without throwing an ObjectStoreLimitReachedException |
long |
getMaxTime()
Get the maximum time a query may take before throwing an ObjectStoreQueryDurationException |
Model |
getModel()
Return the metadata associated with this ObjectStore |
ObjectStoreWriter |
getNewWriter()
Create an ObjectStoreWriter that writes into this ObjectStore. |
InterMineObject |
getObjectByExample(InterMineObject o,
java.util.Set<java.lang.String> fieldNames)
Return an object from the objectstore that has the fields mentioned in the list set to the same values as the fields in the provided example object. |
InterMineObject |
getObjectById(java.lang.Integer id)
Get an object from the ObjectStore by giving an ID. |
InterMineObject |
getObjectById(java.lang.Integer id,
java.lang.Class<? extends InterMineObject> clazz)
Get an object from the ObjectStore by giving an ID and a hint of the Class of the object. |
java.util.List<InterMineObject> |
getObjectsByIds(java.util.Collection<java.lang.Integer> ids)
Get an objects from the ObjectStore that have the IDs in the ids colection |
java.util.Map<java.lang.Object,java.lang.Integer> |
getSequence(java.util.Set<java.lang.Object> tables)
Return the sequence number representing the state of the ObjectStore. |
java.lang.Integer |
getSerial()
Gets an ID number which is unique in the database. |
void |
invalidateObjectById(java.lang.Integer id)
Removes an entry from the objectstore getObjectById cache. |
boolean |
isMultiConnection()
Return whether or not this ObjectStore gives a performance improvement when multiple simultaneous are made. |
InterMineObject |
pilferObjectById(java.lang.Integer id)
Gets a object from the cache if it is present. |
void |
prefetchObjectById(java.lang.Integer id)
Prefetches an object into the objectstore getObjectById cache. |
| Field Detail |
|---|
static final java.util.Map<java.lang.Object,java.lang.Integer> SEQUENCE_IGNORE
| Method Detail |
|---|
ObjectStoreWriter getNewWriter()
throws ObjectStoreException
ObjectStoreException - if an error occurs
java.lang.UnsupportedOperationException - if no writer is available for this ObjectStoreResults execute(Query q)
q - the Query to execute
Results execute(Query q,
int batchSize,
boolean optimise,
boolean explain,
boolean prefetch)
q - the Query to executebatchSize - the batch size to initialise the Results object withoptimise - whether to optimise queriesexplain - whether to explain queriesprefetch - whether to use the PrefetchManager
SingletonResults executeSingleton(Query q)
q - the Query to execute
SingletonResults executeSingleton(Query q,
int batchSize,
boolean optimise,
boolean explain,
boolean prefetch)
q - the Query to executebatchSize - the batch size to initialise the Results object withoptimise - whether to optimise queriesexplain - whether to explain queriesprefetch - whether to use the PrefetchManager
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(Query q).
q - the Query to executestart - the start rowlimit - the maximum number of rows to returnoptimise - true if it is expected that optimising the query will improve performanceexplain - true if the ObjectStore should enforce maximum query running time constraintssequence - 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
ObjectStoreException - if an error occurs during the running of the Query
InterMineObject getObjectById(java.lang.Integer id)
throws ObjectStoreException
id - the ID of the object to fetch
ObjectStoreException - if an error occurs during retrieval of the object
InterMineObject getObjectById(java.lang.Integer id,
java.lang.Class<? extends InterMineObject> clazz)
throws ObjectStoreException
id - the ID of the object to fetchclazz - a class of the object
ObjectStoreException - if an error occurs during the retrieval of the object
java.util.List<InterMineObject> getObjectsByIds(java.util.Collection<java.lang.Integer> ids)
throws ObjectStoreException
ids - the IDs of the objects to fetch
ObjectStoreException - if an error occurs during retrieval of the objectvoid prefetchObjectById(java.lang.Integer id)
This method is provided primarily to help speed up our data loader. The method may block until the prefetch has been completed. However, the prefetch can be done outside of any synchronised areas of code, allowing the time-critical synchronised areas of code to access the object from the cache.
id - the ID of the object to prefetchvoid invalidateObjectById(java.lang.Integer id)
id - the ID of the object to invalidate
java.lang.Object cacheObjectById(java.lang.Integer id,
InterMineObject obj)
id - the ID of the objectobj - a fully populated object, as loaded from the database, or null to negatively
cache
void flushObjectById()
InterMineObject pilferObjectById(java.lang.Integer id)
id - the ID of the object
ResultsInfo estimate(Query q)
throws ObjectStoreException
q - the query to estimate rows for
ObjectStoreException - if an error occurs explaining the query
int count(Query q,
java.util.Map<java.lang.Object,java.lang.Integer> sequence)
throws ObjectStoreException
q - InterMine Query on which to count rowssequence - 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
ObjectStoreException - if an error occurs counting the queryModel getModel()
InterMineObject getObjectByExample(InterMineObject o,
java.util.Set<java.lang.String> fieldNames)
throws ObjectStoreException
o - an example objectfieldNames - a Set of fieldnames
ObjectStoreException - if an underlying error occursboolean isMultiConnection()
java.util.Set<java.lang.Object> getComponentsForQuery(Query q)
q - a Query
java.util.Map<java.lang.Object,java.lang.Integer> getSequence(java.util.Set<java.lang.Object> tables)
tables - a Set of independent database components to get data for
int getMaxLimit()
int getMaxOffset()
long getMaxTime()
java.lang.Integer getSerial()
throws ObjectStoreException
ObjectStoreException - if a problem occurs
ObjectStoreBag createObjectStoreBag()
throws ObjectStoreException
ObjectStoreException - if an error occurs fetching a new ID
Clob createClob()
throws ObjectStoreException
ObjectStoreException - if an error occurs fetching a new ID
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||