|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--weka.experiment.DatabaseUtils
|
+--weka.experiment.DatabaseResultListener
DatabaseResultListener takes the results from a ResultProducer and submits them to a central database.
| Field Summary | |
protected FastVector |
m_Cache
Stores the cached values |
protected java.lang.Object[] |
m_CacheKey
Stores the key for which the cache is valid |
protected int |
m_CacheKeyIndex
Stores the index of the key column holding the cache key data |
protected java.lang.String |
m_CacheKeyName
Holds the name of the key field to cache upon, or null if no caching |
protected boolean |
m_Debug
True if debugging output should be printed |
protected ResultProducer |
m_ResultProducer
The ResultProducer to listen to |
protected java.lang.String |
m_ResultsTableName
The name of the current results table |
| Fields inherited from class weka.experiment.DatabaseUtils |
DRIVERS, EXP_INDEX_TABLE, EXP_RESULT_COL, EXP_RESULT_PREFIX, EXP_SETUP_COL, EXP_TYPE_COL, m_Connection, m_DatabaseURL, m_Statement, PROPERTIES, PROPERTY_FILE |
| Constructor Summary | |
DatabaseResultListener()
Sets up the database drivers |
|
| Method Summary | |
void |
acceptResult(ResultProducer rp,
java.lang.Object[] key,
java.lang.Object[] result)
Submit the result to the appropriate table of the database |
java.lang.String |
cacheKeyNameTipText()
Returns the tip text for this property |
java.lang.String[] |
determineColumnConstraints(ResultProducer rp)
Determines if there are any constraints (imposed by the destination) on any additional measures produced by resultProducers. |
java.lang.String |
getCacheKeyName()
Get the value of CacheKeyName. |
java.lang.String |
globalInfo()
Returns a string describing this result listener |
protected boolean |
isCacheValid(java.lang.Object[] key)
Checks whether the current cache contents are valid for the supplied key. |
protected boolean |
isKeyInCache(ResultProducer rp,
java.lang.Object[] key)
Returns true if the supplied key is in the key cache (and thus we do not need to execute a database query). |
boolean |
isResultRequired(ResultProducer rp,
java.lang.Object[] key)
Always says a result is required. |
protected void |
loadCache(ResultProducer rp,
java.lang.Object[] key)
Executes a database query to fill the key cache |
void |
postProcess(ResultProducer rp)
Perform any postprocessing. |
void |
preProcess(ResultProducer rp)
Prepare for the results to be received. |
void |
setCacheKeyName(java.lang.String newCacheKeyName)
Set the value of CacheKeyName. |
protected void |
updateResultsTableName(ResultProducer rp)
Determines the table name that results will be inserted into. |
| Methods inherited from class weka.experiment.DatabaseUtils |
arrayToString, connectToDatabase, createExperimentIndex, createExperimentIndexEntry, createResultsTable, databaseURLTipText, disconnectFromDatabase, execute, experimentIndexExists, getDatabaseURL, getResultFromTable, getResultSet, getResultsTableName, isConnected, isKeyInTable, putResultInTable, setDatabaseURL, tableExists, typeName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ResultProducer m_ResultProducer
protected java.lang.String m_ResultsTableName
protected boolean m_Debug
protected java.lang.String m_CacheKeyName
protected int m_CacheKeyIndex
protected java.lang.Object[] m_CacheKey
protected FastVector m_Cache
| Constructor Detail |
public DatabaseResultListener()
throws java.lang.Exception
java.lang.Exception - if an error occurs| Method Detail |
public java.lang.String globalInfo()
public void preProcess(ResultProducer rp)
throws java.lang.Exception
preProcess in interface ResultListenerrp - the ResultProducer that will generate the resultsjava.lang.Exception - if an error occurs during preprocessing.
public void postProcess(ResultProducer rp)
throws java.lang.Exception
postProcess in interface ResultListenerrp - the ResultProducer that generated the resultsjava.lang.Exception - if an error occurs
public java.lang.String[] determineColumnConstraints(ResultProducer rp)
throws java.lang.Exception
determineColumnConstraints in interface ResultListenerrp - the ResultProducer to which the constraints will applyjava.lang.Exception - if an error occurs.
public void acceptResult(ResultProducer rp,
java.lang.Object[] key,
java.lang.Object[] result)
throws java.lang.Exception
acceptResult in interface ResultListenerrp - the ResultProducer that generated the resultkey - The key for the results.result - The actual results.java.lang.Exception - if the result couldn't be sent to the database
public boolean isResultRequired(ResultProducer rp,
java.lang.Object[] key)
throws java.lang.Exception
isResultRequired in interface ResultListenerrp - the ResultProducer wanting to generate the resultkey - The key for which a result may be needed.java.lang.Exception - if the database couldn't be queried
protected void updateResultsTableName(ResultProducer rp)
throws java.lang.Exception
rp - the ResultProducerjava.lang.Exception - if an error occurspublic java.lang.String cacheKeyNameTipText()
public java.lang.String getCacheKeyName()
public void setCacheKeyName(java.lang.String newCacheKeyName)
newCacheKeyName - Value to assign to CacheKeyName.protected boolean isCacheValid(java.lang.Object[] key)
key - the results key
protected boolean isKeyInCache(ResultProducer rp,
java.lang.Object[] key)
throws java.lang.Exception
rp - the ResultProducer the key belongs to.key - the result keyjava.lang.Exception - if an error occurs
protected void loadCache(ResultProducer rp,
java.lang.Object[] key)
throws java.lang.Exception
rp - the ResultProducer the key belongs tokey - the keyjava.lang.Exception - if an error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||