public class ExperimentDAOImpl extends AbstractExperimentDAO
AbstractExperimentDAO class.EXPERIMENT_TASK_NOT_CACHED, initialized, resultDurabilityCACHED_EXPERIMENT_TASK_CAN_BE_USED, TASK_FINISHED, TASK_NOT_FOUND, TASK_STARTED_BUT_NOT_FINISHED_YET| Constructor and Description |
|---|
ExperimentDAOImpl(DataSource dataSource) |
ExperimentDAOImpl(DataSource dataSource,
long resultDurability) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAdditionalResults(ExperimentTaskResult result) |
protected void |
addAdditionaResult(int taskId,
int resultId,
double value) |
protected void |
addSubTaskRelation(int taskId,
int subTaskId) |
protected void |
addSubTasks(ExperimentTaskResult expTask) |
void |
close() |
protected void |
connectExistingTaskWithExperiment(int experimentTaskId,
String experimentId)
This method connects an already existing experiment task with an
experiment.
|
int |
createTask(String annotatorName,
String datasetName,
String experimentType,
String matching,
String experimentId)
Creates a new experiment task with the given preferences, sets its GERBIL
version value using the current version, sets the task to unfinished by
setting its state to
ExperimentDAO.TASK_STARTED_BUT_NOT_FINISHED_YET and
connects it to the experiment with the given experiment id. |
List<ExperimentTaskResult> |
getAllRunningExperimentTasks()
Returns a list of all running experiment tasks.
|
protected List<String[]> |
getAnnotatorDatasetCombinations(String experimentType,
String matching)
Deprecated.
|
protected int |
getCachedExperimentTaskId(String annotatorName,
String datasetName,
String experimentType,
String matching)
The method checks whether there exists an experiment task with the given
preferences inside the database.
|
int |
getExperimentState(int experimentTaskId)
Returns the state of the existing experiment task, identified by the
given id.
|
String |
getHighestExperimentId()
Returns the highest experiment ID that is known by the system or null if
there are no experiments.
|
protected ExperimentTaskResult |
getLatestExperimentTaskResult(String experimentType,
String matching,
String annotatorName,
String datasetName)
Deprecated.
|
List<ExperimentTaskResult> |
getLatestResultsOfExperiments(String experimentType,
String matching)
Returns the latest results for experiments with the given experiment type
and matching type.
|
List<ExperimentTaskResult> |
getLatestResultsOfExperiments(String experimentType,
String matching,
String[] annotatorNames,
String[] datasetNames)
Returns the latest results for experiments with the given experiment type
and matching type.
|
ExperimentTaskResult |
getResultOfExperimentTask(int experimentTaskId)
Returns the result of the experiment task with the given ID or null if
this task does not exist.
|
List<ExperimentTaskResult> |
getResultsOfExperiment(String experimentId)
Returns the results of the experiment tasks that are connected to the
experiment with the given experiment id.
|
protected void |
insertSubTask(ExperimentTaskResult subTask,
int experimentTaskId) |
void |
setExperimentState(int experimentTaskId,
int state)
Sets the state of the already existing experiment task, identified by the
given id.
|
void |
setExperimentTaskResult(int experimentTaskId,
ExperimentTaskResult result)
This method updates the result of the already existing experiment task,
identified by the given id.
|
protected void |
setRunningExperimentsToError()
Searches the database for experiment tasks that have been started but not
ended yet (their status equals
ExperimentDAO.TASK_STARTED_BUT_NOT_FINISHED_YET ) and set their status to
ErrorTypes.SERVER_STOPPED_WHILE_PROCESSING. |
connectCachedResultOrCreateTask, getResultDurability, initialize, setResultDurabilitypublic ExperimentDAOImpl(DataSource dataSource)
public ExperimentDAOImpl(DataSource dataSource, long resultDurability)
public List<ExperimentTaskResult> getResultsOfExperiment(String experimentId)
ExperimentDAOexperimentId - if of the experimentpublic int createTask(String annotatorName, String datasetName, String experimentType, String matching, String experimentId)
ExperimentDAOExperimentDAO.TASK_STARTED_BUT_NOT_FINISHED_YET and
connects it to the experiment with the given experiment id.annotatorName - the name with which the annotator can be identifieddatasetName - the name of the datasetexperimentType - the name of the experiment typematching - the name of the matching usedexperimentId - the id of the experimentpublic void setExperimentTaskResult(int experimentTaskId,
ExperimentTaskResult result)
ExperimentDAOexperimentTaskId - the id of the experiment task to which the result has been
calculatedresult - the result of this experiment taskprotected void addAdditionaResult(int taskId,
int resultId,
double value)
public void setExperimentState(int experimentTaskId,
int state)
ExperimentDAOexperimentTaskId - the id of the experiment task for which the state should be
setstate - the state of this experiment taskpublic int getExperimentState(int experimentTaskId)
ExperimentDAOexperimentTaskId - the id of the experiment task for which the state should be
retrievedExperimentDAO.TASK_NOT_FOUND=
-2 if such a task couldn't be found.protected int getCachedExperimentTaskId(String annotatorName, String datasetName, String experimentType, String matching)
AbstractExperimentDAOAbstractExperimentDAO.EXPERIMENT_TASK_NOT_CACHED is
returned.
NOTE: this method MUST be synchronized since it should only be
called by a single thread at once.getCachedExperimentTaskId in class AbstractExperimentDAOannotatorName - the name with which the annotator can be identifieddatasetName - the name of the datasetexperimentType - the name of the experiment typematching - the name of the matching usedprotected void connectExistingTaskWithExperiment(int experimentTaskId,
String experimentId)
AbstractExperimentDAOconnectExistingTaskWithExperiment in class AbstractExperimentDAOexperimentTaskId - the id of the experiment taskexperimentId - the id of the experimentpublic String getHighestExperimentId()
ExperimentDAOprotected void setRunningExperimentsToError()
AbstractExperimentDAOExperimentDAO.TASK_STARTED_BUT_NOT_FINISHED_YET ) and set their status to
ErrorTypes.SERVER_STOPPED_WHILE_PROCESSING. This method should
only be called directly after the initialization of the database. It
makes sure that "old" experiment tasks which have been started but never
finished are set to an error state and can't be used inside the caching
mechanism.setRunningExperimentsToError in class AbstractExperimentDAO@Deprecated protected List<String[]> getAnnotatorDatasetCombinations(String experimentType, String matching)
AbstractExperimentDAOgetAnnotatorDatasetCombinations in class AbstractExperimentDAOexperimentType - the name of the experiment typematching - the name of the matching used@Deprecated protected ExperimentTaskResult getLatestExperimentTaskResult(String experimentType, String matching, String annotatorName, String datasetName)
AbstractExperimentDAOgetLatestExperimentTaskResult in class AbstractExperimentDAOexperimentType - the name of the experiment typematching - the name of the matching usedannotatorName - the name with which the annotator can be identifieddatasetName - the name of the datasetpublic List<ExperimentTaskResult> getAllRunningExperimentTasks()
ExperimentDAOpublic List<ExperimentTaskResult> getLatestResultsOfExperiments(String experimentType, String matching)
ExperimentDAOgetLatestResultsOfExperiments in interface ExperimentDAOgetLatestResultsOfExperiments in class AbstractExperimentDAOexperimentType - the name of the experiment typematching - the name of the matching usedpublic List<ExperimentTaskResult> getLatestResultsOfExperiments(String experimentType, String matching, String[] annotatorNames, String[] datasetNames)
ExperimentDAOexperimentType - the name of the experiment typematching - the name of the matching usedannotatorNames - the names of annotators for which the data should be collecteddatasetNames - the names of datasets for which the data should be collectedprotected void addAdditionalResults(ExperimentTaskResult result)
protected void insertSubTask(ExperimentTaskResult subTask, int experimentTaskId)
protected void addSubTaskRelation(int taskId,
int subTaskId)
protected void addSubTasks(ExperimentTaskResult expTask)
public ExperimentTaskResult getResultOfExperimentTask(int experimentTaskId)
ExperimentDAOexperimentTaskId - the id of the experiment taskpublic void close()
throws IOException
IOExceptionCopyright © 2014–2017. All rights reserved.