Package org.intermine.web.task
Class PrecomputeTemplatesTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.intermine.web.task.PrecomputeTemplatesTask
-
public class PrecomputeTemplatesTask extends org.apache.tools.ant.Task
A Task that reads a list of queries from a properties file (eg. testmodel_precompute.properties) and calls ObjectStoreInterMineImpl.precompute() using the Query.- Author:
- Kim Rutherford
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
alias
protected boolean
doSummarise
protected java.lang.String
ignore
protected java.util.Set<java.lang.String>
ignoreNames
protected int
minRows
protected ObjectStore
os
static java.lang.String
PRECOMPUTE_CATEGORY_TEMPLATE
The precompute category to use for templates.protected java.lang.String
username
protected java.lang.String
userProfileAlias
protected ObjectStoreWriter
userProfileOS
-
Constructor Summary
Constructors Constructor Description PrecomputeTemplatesTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
protected java.util.Map<java.lang.String,ApiTemplate>
getPrecomputeTemplateQueries()
Get the super user's public templatesprotected void
precompute(Query query, java.util.Collection<QueryNode> indexes, java.lang.String name)
Call ObjectStoreInterMineImpl.precompute() with the given Query.protected void
precomputeTemplates()
Create precomputed tables for all template queries in the given ObjectStore.void
setAlias(java.lang.String alias)
Set the ObjectStore aliasvoid
setIgnore(java.lang.String ignore)
Set a comma separated list of template names to ignore - i.e.void
setMinRows(java.lang.Integer minRows)
Set the minimum row count for precomputed queries.void
setSummarise(java.lang.String summarise)
Set the summarise flag.void
setUsername(java.lang.String user)
Set the account name to laod template to.void
setUserProfileAlias(java.lang.String userProfileAlias)
Set the alias of the userprofile object store.-
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Field Detail
-
PRECOMPUTE_CATEGORY_TEMPLATE
public static final java.lang.String PRECOMPUTE_CATEGORY_TEMPLATE
The precompute category to use for templates.- See Also:
- Constant Field Values
-
alias
protected java.lang.String alias
-
minRows
protected int minRows
-
os
protected ObjectStore os
-
userProfileOS
protected ObjectStoreWriter userProfileOS
-
userProfileAlias
protected java.lang.String userProfileAlias
-
username
protected java.lang.String username
-
ignore
protected java.lang.String ignore
-
ignoreNames
protected java.util.Set<java.lang.String> ignoreNames
-
doSummarise
protected boolean doSummarise
-
-
Method Detail
-
setAlias
public void setAlias(java.lang.String alias)
Set the ObjectStore alias- Parameters:
alias
- the ObjectStore alias
-
setIgnore
public void setIgnore(java.lang.String ignore)
Set a comma separated list of template names to ignore - i.e. not precompute.- Parameters:
ignore
- the list to ignore
-
setUserProfileAlias
public void setUserProfileAlias(java.lang.String userProfileAlias)
Set the alias of the userprofile object store.- Parameters:
userProfileAlias
- the object store alias of the userprofile database
-
setMinRows
public void setMinRows(java.lang.Integer minRows)
Set the minimum row count for precomputed queries. Queries that are estimated to have less than this number of rows will not be precomputed.- Parameters:
minRows
- the minimum row count
-
setUsername
public void setUsername(java.lang.String user)
Set the account name to laod template to.- Parameters:
user
- username to load templates into
-
setSummarise
public void setSummarise(java.lang.String summarise)
Set the summarise flag.- Parameters:
summarise
- if true, summarise while precomputing
-
execute
public void execute()
- Overrides:
execute
in classorg.apache.tools.ant.Task
-
precomputeTemplates
protected void precomputeTemplates()
Create precomputed tables for all template queries in the given ObjectStore.
-
precompute
protected void precompute(Query query, java.util.Collection<QueryNode> indexes, java.lang.String name)
Call ObjectStoreInterMineImpl.precompute() with the given Query.- Parameters:
query
- the query to precomputeindexes
- the index QueryNodesname
- the name of the query we are precomputing (used for documentation is an exception is thrown- Throws:
org.apache.tools.ant.BuildException
- if the query cannot be precomputed.
-
getPrecomputeTemplateQueries
protected java.util.Map<java.lang.String,ApiTemplate> getPrecomputeTemplateQueries()
Get the super user's public templates- Returns:
- Map from template name to TemplateQuery
- Throws:
org.apache.tools.ant.BuildException
- if an IO error occurs loading the template queries
-
-