public interface ExperimentDAO extends Closeable
| Modifier and Type | Field and Description |
|---|---|
static int |
CACHED_EXPERIMENT_TASK_CAN_BE_USED
Sentinel value indicating that the database already contains a result for
an experiment task which can be reused by an experiment.
|
static int |
TASK_FINISHED
Sentinel value stored as state in the database indicating that a task has
been finished.
|
static int |
TASK_NOT_FOUND
Sentinel value returned if the task with the given id couldn't be found.
|
static int |
TASK_STARTED_BUT_NOT_FINISHED_YET
Sentinel value stored as state in the database indicating that a task has
been started but there weren't stored any results until now.
|
| Modifier and Type | Method and Description |
|---|---|
int |
connectCachedResultOrCreateTask(String annotatorName,
String datasetName,
String experimentType,
String matching,
String experimentId)
This method is called with the description of an experiment task and an
experiment id.
|
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
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.
|
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.
|
List<ExperimentTaskResult> |
getLatestResultsOfExperiments(String experimentType,
String matching)
Deprecated.
|
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.
|
void |
initialize()
Initializes the database.
|
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.
|
void |
setResultDurability(long milliseconds)
Sets the durability of a experiment task result.
|
static final int CACHED_EXPERIMENT_TASK_CAN_BE_USED
static final int TASK_FINISHED
static final int TASK_STARTED_BUT_NOT_FINISHED_YET
static final int TASK_NOT_FOUND
void initialize()
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.void setResultDurability(long milliseconds)
milliseconds - List<ExperimentTaskResult> getResultsOfExperiment(String experimentId)
experimentId - if of the experimentExperimentTaskResult getResultOfExperimentTask(int experimentTaskId)
experimentTaskId - the id of the experiment taskint connectCachedResultOrCreateTask(String annotatorName, String datasetName, String experimentType, String matching, String experimentId)
CACHED_EXPERIMENT_TASK_CAN_BE_USED
= -1 is returned. Otherwise, a
new experiment task is created, set to unfinished by setting its state to
TASK_STARTED_BUT_NOT_FINISHED_YET, connected to the given
experiment and the id of the newly created experiment task is returned.
NOTE: this method MUST be synchronized since it should only be
called by a single thread at once.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 experimentCACHED_EXPERIMENT_TASK_CAN_BE_USED=
-1 if there is already
an experiment task with the given preferences or the id of the
newly created experiment task.int createTask(String annotatorName, String datasetName, String experimentType, String matching, String experimentId)
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 experimentvoid setExperimentTaskResult(int experimentTaskId,
ExperimentTaskResult result)
experimentTaskId - the id of the experiment task to which the result has been
calculatedresult - the result of this experiment taskvoid setExperimentState(int experimentTaskId,
int state)
experimentTaskId - the id of the experiment task for which the state should be
setstate - the state of this experiment taskint getExperimentState(int experimentTaskId)
experimentTaskId - the id of the experiment task for which the state should be
retrievedTASK_NOT_FOUND=
-2 if such a task couldn't be found.String getHighestExperimentId()
@Deprecated List<ExperimentTaskResult> getLatestResultsOfExperiments(String experimentType, String matching)
experimentType - the name of the experiment typematching - the name of the matching usedList<ExperimentTaskResult> getLatestResultsOfExperiments(String experimentType, String matching, String[] annotatorNames, String[] datasetNames)
experimentType - 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 collectedList<ExperimentTaskResult> getAllRunningExperimentTasks()
Copyright © 2014–2017. All rights reserved.