|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.intermine.task.CreateIndexesTask
public class CreateIndexesTask
Task to create indexes on a database holding objects conforming to a given model by reading that model's primary key configuration information. By default three types of index are created: for the specified primary key fields, for all N-1 relations, and for the indirection table columns of M-N relations. Alternatively, if attributeIndexes is true, indexes are created for all non-primary key attributes instead. Note that all "id" columns are indexed automatically by virtue of InterMineTorqueModelOuput specifying them as primary key columns.
| Field Summary |
|---|
| Fields inherited from class org.apache.tools.ant.Task |
|---|
description, location, target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
project |
| Constructor Summary | |
|---|---|
CreateIndexesTask()
|
|
| Method Summary | |
|---|---|
protected void |
createIndex(java.sql.Connection conn,
java.lang.String indexName,
org.intermine.task.IndexStatement indexStatement,
int threadNo)
Create an named index on the specified columns of a table. |
protected void |
dropIndex(java.lang.String indexName)
Drop an index by name, ignoring any resulting errors |
void |
execute()
|
protected void |
execute(java.sql.Connection conn,
java.lang.String sql)
Execute an sql statement. |
protected void |
getAttributeIndexStatements(ClassDescriptor cld,
java.util.Map<java.lang.String,org.intermine.task.IndexStatement> statements)
Add indexes for all fields to the relevant tables for a given ClassDescriptor. |
protected void |
getStandardIndexStatements(ClassDescriptor cld,
java.util.Map<java.lang.String,org.intermine.task.IndexStatement> statements)
Add indexes for primary keys, indirection tables and 1-N relations to the relevant tables for a given ClassDescriptor |
void |
setAlias(java.lang.String alias)
Set the ObjectStore alias. |
void |
setAttributeIndexes(boolean attributeIndexes)
Set the attributeIndexes flag. |
void |
setExtraThreads(int extraThreads)
Set the number of extra worker threads. |
void |
setObjectStore(ObjectStore objectStore)
Set the ObjectStore to use. |
void |
setUp()
Sets up the instance variables |
| 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 |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
getProject, setProject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CreateIndexesTask()
| Method Detail |
|---|
public void setAlias(java.lang.String alias)
alias - the ObjectStore aliaspublic void setObjectStore(ObjectStore objectStore)
objectStore - ObjectStore to create indexes onpublic void setAttributeIndexes(boolean attributeIndexes)
attributeIndexes - flag for attribute indexespublic void setExtraThreads(int extraThreads)
extraThreads - number of extra threads apart from the main threadpublic void setUp()
org.apache.tools.ant.BuildException - if something is wrongpublic void execute()
execute in class org.apache.tools.ant.Task
protected void getStandardIndexStatements(ClassDescriptor cld,
java.util.Map<java.lang.String,org.intermine.task.IndexStatement> statements)
throws MetaDataException
cld - the ClassDescriptorstatements - the index creation statements for the given cld are added to this Map.
The key is the index name, the value is a IndexStatement.
MetaDataException - if a field os not found in model
protected void getAttributeIndexStatements(ClassDescriptor cld,
java.util.Map<java.lang.String,org.intermine.task.IndexStatement> statements)
cld - the ClassDescriptorstatements - the index creation statements for the given cld are added to this Map.
The key is the index name, the value is a IndexStatement.protected void dropIndex(java.lang.String indexName)
indexName - the index name
protected void createIndex(java.sql.Connection conn,
java.lang.String indexName,
org.intermine.task.IndexStatement indexStatement,
int threadNo)
conn - a ConnectionindexName - the index nameindexStatement - the IndexStatementthreadNo - the number of the calling thread
protected void execute(java.sql.Connection conn,
java.lang.String sql)
throws java.sql.SQLException
conn - a Connectionsql - the sql string for the statement to execute
java.sql.SQLException - if an error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||