|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.sql.precompute.BestQuery
org.intermine.sql.precompute.BestQueryExplainer
public class BestQueryExplainer
Gets the database to explain each Query added and keeps hold of the best one so far.
| Nested Class Summary | |
|---|---|
protected class |
BestQueryExplainer.Candidate
A class representing a candidate optimised query. |
| Field Summary | |
|---|---|
protected static int |
ALWAYS_EXPLAIN_TABLES
|
protected BestQueryExplainer.Candidate |
bestCandidate
|
protected java.util.List<BestQueryExplainer.Candidate> |
candidates
|
protected int |
candidateTables
|
protected java.sql.Connection |
con
|
protected static int |
NEVER_EXPLAIN_TABLES
|
protected java.util.Date |
start
|
protected long |
timeLimit
|
| Constructor Summary | |
|---|---|
BestQueryExplainer()
Constructs an empty BestQueryExplainer for testing purposes |
|
BestQueryExplainer(java.sql.Connection con,
long timeLimit)
Constructs a BestQueryExplainer that will use the given Connection to explain Queries. |
|
| Method Summary | |
|---|---|
protected void |
add(BestQueryExplainer.Candidate c)
Allows a Candidate to be added to this tracker. |
void |
add(Query q)
Allows a Query to be added to this tracker. |
void |
add(java.lang.String q)
Allows a Query to be added to this tracker. |
protected void |
didNotExplain(BestQueryExplainer.Candidate c)
Internal method that records that a query was not explained. |
protected BestQueryExplainer.Candidate |
getBest()
Gets the best Candidate found so far. |
ExplainResult |
getBestExplainResult()
Gets the ExpainResult for the best Query found so far. |
Query |
getBestQuery()
Gets the best Query found so far |
java.lang.String |
getBestQueryString()
Gets the best query String found so far. |
protected ExplainResult |
getExplainResult(Query q)
Internal method that creates an ExplainResult. |
protected ExplainResult |
getExplainResult(java.lang.String q)
Internal method that creates an ExplainResult. |
void |
throwBestQueryException(java.lang.String message)
Throws an exception. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int ALWAYS_EXPLAIN_TABLES
protected static final int NEVER_EXPLAIN_TABLES
protected java.util.List<BestQueryExplainer.Candidate> candidates
protected int candidateTables
protected BestQueryExplainer.Candidate bestCandidate
protected java.sql.Connection con
protected java.util.Date start
protected long timeLimit
| Constructor Detail |
|---|
public BestQueryExplainer()
public BestQueryExplainer(java.sql.Connection con,
long timeLimit)
con - the Connection to usetimeLimit - a time limit in milliseconds| Method Detail |
|---|
public void add(Query q)
throws BestQueryException,
java.sql.SQLException
add in class BestQueryq - a Query to be added to the tracker
BestQueryException - if the current best Query is the best we think we are going to get
java.sql.SQLException - if error occurs in the underlying database
public void add(java.lang.String q)
throws BestQueryException,
java.sql.SQLException
add in class BestQueryq - a query String to be added to the tracker
BestQueryException - if the current best Query is the best we think we are going to get
java.sql.SQLException - if error occurs in the underlying database
protected void add(BestQueryExplainer.Candidate c)
throws BestQueryException,
java.sql.SQLException
c - the Candidate
BestQueryException - if the current best Candidate is the best we think we are going to
get
java.sql.SQLException - if an error occurs in the underlying database
protected ExplainResult getExplainResult(Query q)
throws java.sql.SQLException
q - the Query
java.sql.SQLException - if an error occurs in the underlying database
protected ExplainResult getExplainResult(java.lang.String q)
throws java.sql.SQLException
q - the query String
java.sql.SQLException - if an error occurs in the underlying databaseprotected void didNotExplain(BestQueryExplainer.Candidate c)
c - the Candidate
public Query getBestQuery()
throws java.sql.SQLException
getBestQuery in class BestQueryjava.sql.SQLException - if an error occurs in the underlying database
public java.lang.String getBestQueryString()
throws java.sql.SQLException
getBestQueryString in class BestQueryjava.sql.SQLException - if an error occurs in the underlying database
public ExplainResult getBestExplainResult()
throws java.sql.SQLException
java.sql.SQLException - if an error occurs in the underlying database
protected BestQueryExplainer.Candidate getBest()
throws java.sql.SQLException
java.sql.SQLException - if an error occurs in the underlying database
public void throwBestQueryException(java.lang.String message)
throws BestQueryException
message - a message
BestQueryException - with the message
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||