Commit caf40dcf authored by Leo Gordon's avatar Leo Gordon
Browse files

At last rename GET_INPUT into FETCH_INPUT for consistency between the schema...

At last rename GET_INPUT into FETCH_INPUT for consistency between the schema and the code (it seems to be harder to patch all the accumulated code)
parent a735dcb4
......@@ -224,7 +224,7 @@ sub fetch_all_failed_jobs {
sub fetch_all_incomplete_jobs_by_worker_id {
my ($self, $worker_id) = @_;
my $constraint = "j.status IN ('COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT') AND j.worker_id='$worker_id'";
my $constraint = "j.status IN ('COMPILATION','FETCH_INPUT','RUN','WRITE_OUTPUT') AND j.worker_id='$worker_id'";
return $self->_generic_fetch($constraint);
}
......@@ -550,7 +550,7 @@ sub reclaim_job_for_worker {
Description: If a worker has died some of its jobs need to be reset back to 'READY'
so they can be rerun.
Jobs in state CLAIMED as simply reset back to READY.
If jobs was in a 'working' state (COMPILATION, GET_INPUT, RUN, WRITE_OUTPUT)
If jobs was in a 'working' state (COMPILATION, FETCH_INPUT, RUN, WRITE_OUTPUT)
the retry_count is increased and the status set back to READY.
If the retry_count >= $max_retry_count (3 by default) the job is set
to 'FAILED' and not rerun again.
......@@ -578,7 +578,7 @@ sub release_undone_jobs_from_worker {
SELECT job_id
FROM job
WHERE worker_id='$worker_id'
AND status in ('COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT')
AND status in ('COMPILATION','FETCH_INPUT','RUN','WRITE_OUTPUT')
} );
$sth->execute();
......@@ -624,7 +624,7 @@ sub release_and_age_job {
UPDATE job
SET status=(CASE WHEN $may_retry AND (retry_count<$max_retry_count) THEN 'READY' ELSE 'FAILED' END), retry_count=retry_count+1
WHERE job_id=$job_id
AND status in ('COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT')
AND status in ('COMPILATION','FETCH_INPUT','RUN','WRITE_OUTPUT')
} );
}
......
......@@ -33,7 +33,7 @@ Available parameters:
param('lethal_after'): makes jobs' failures lethal when 'value' is greater than this parameter
param('time_GET_INPUT'): time in seconds that the job will spend sleeping in GET_INPUT state.
param('time_FETCH_INPUT'): time in seconds that the job will spend sleeping in FETCH_INPUT state.
param('time_RUN'): time in seconds that the job will spend sleeping in RUN state.
......@@ -70,7 +70,7 @@ sub param_defaults {
'state' => 'RUN', # the state in which the process may commit apoptosis
'lethal_after' => 0, # If value is above this (nonzero) threshold, job's death becomes lethal to the worker.
'time_GET_INPUT' => 0, # how much time fetch_input() will spend in sleeping state
'time_FETCH_INPUT' => 0, # how much time fetch_input() will spend in sleeping state
'time_RUN' => 1, # how much time run() will spend in sleeping state
'time_WRITE_OUTPUT' => 0, # how much time write_output() will spend in sleeping state
};
......@@ -86,7 +86,7 @@ sub param_defaults {
sub fetch_input {
my $self = shift @_;
$self->dangerous_math('GET_INPUT');
$self->dangerous_math('FETCH_INPUT');
}
=head2 run
......
......@@ -707,7 +707,7 @@ sub run_module_with_job {
$job->param_init( $runnable_object->strict_hash_format(), $runnable_object->param_defaults(), $self->db->get_MetaContainer->get_param_hash(), $self->analysis->parameters(), $job->input_id() );
$job->autoflow(1);
$self->enter_status('GET_INPUT', $job);
$self->enter_status('FETCH_INPUT', $job);
$self->{'fetching_stopwatch'}->continue();
$runnable_object->fetch_input;
......
......@@ -32,10 +32,10 @@ if($reg_conf) {
Bio::EnsEMBL::Registry->load_all($reg_conf);
}
my $process = $runnable_module->new();
my $runnable_object = $runnable_module->new();
my $job = Bio::EnsEMBL::Hive::AnalysisJob->new();
my ($param_hash, $param_list) = parse_cmdline_options();
$job->param_init( 1, $process->param_defaults(), $param_hash );
$job->param_init( 1, $runnable_object->param_defaults(), $param_hash );
$flow_into = $flow_into ? destringify($flow_into) : []; # empty dataflow for branch 1 by default
$flow_into = { 1 => $flow_into } unless(ref($flow_into) eq 'HASH'); # force non-hash into a hash
......@@ -54,21 +54,21 @@ $job->autoflow(1);
$job->input_id( $input_id );
warn "\nRunning '$runnable_module' with '$input_id' :\n";
$process->input_job($job);
$runnable_object->input_job($job);
if($debug) {
$process->debug($debug);
$runnable_object->debug($debug);
}
# job's life cycle:
warn "\nFETCH_INPUT:\n";
$process->fetch_input();
$runnable_object->fetch_input();
warn "\nRUN:\n";
$process->run();
$runnable_object->run();
unless($no_write) {
warn "\nWRITE_OUTPUT:\n";
$process->write_output();
$runnable_object->write_output();
if( $job->autoflow ) {
warn "\nAUTOFLOW input->output\n";
......
## At last rename GET_INPUT into FETCH_INPUT for consistency between the schema and the code (it seems to be harder to patch all the accumulated code):
ALTER TABLE worker MODIFY COLUMN status enum('READY','COMPILATION','FETCH_INPUT','RUN','WRITE_OUTPUT','DEAD') DEFAULT 'READY' NOT NULL;
ALTER TABLE job MODIFY COLUMN status enum('READY','BLOCKED','CLAIMED','COMPILATION','FETCH_INPUT','RUN','WRITE_OUTPUT','DONE','FAILED','PASSED_ON') DEFAULT 'READY' NOT NULL;
ALTER TABLE job_message MODIFY COLUMN status enum('UNKNOWN', 'COMPILATION', 'FETCH_INPUT', 'RUN', 'WRITE_OUTPUT', 'PASSED_ON') DEFAULT 'UNKNOWN';
......@@ -111,7 +111,7 @@ CREATE TABLE worker (
host varchar(40) DEFAULT NULL,
process_id varchar(40) DEFAULT NULL,
work_done int(11) DEFAULT '0' NOT NULL,
status enum('READY','COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT','DEAD') DEFAULT 'READY' NOT NULL,
status enum('READY','COMPILATION','FETCH_INPUT','RUN','WRITE_OUTPUT','DEAD') DEFAULT 'READY' NOT NULL,
born timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_check_in datetime NOT NULL,
died datetime DEFAULT NULL,
......@@ -224,7 +224,7 @@ CREATE TABLE job (
analysis_id int(10) unsigned NOT NULL,
input_id char(255) NOT NULL,
worker_id int(10) unsigned DEFAULT NULL,
status enum('READY','BLOCKED','CLAIMED','COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT','DONE','FAILED','PASSED_ON') DEFAULT 'READY' NOT NULL,
status enum('READY','BLOCKED','CLAIMED','COMPILATION','FETCH_INPUT','RUN','WRITE_OUTPUT','DONE','FAILED','PASSED_ON') DEFAULT 'READY' NOT NULL,
retry_count int(10) default 0 NOT NULL,
completed datetime DEFAULT NULL,
runtime_msec int(10) default NULL,
......@@ -265,7 +265,7 @@ CREATE TABLE job_message (
worker_id int(10) unsigned NOT NULL,
time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
retry int(10) DEFAULT 0 NOT NULL,
status enum('UNKNOWN', 'COMPILATION', 'GET_INPUT', 'RUN', 'WRITE_OUTPUT', 'PASSED_ON') DEFAULT 'UNKNOWN',
status enum('UNKNOWN', 'COMPILATION', 'FETCH_INPUT', 'RUN', 'WRITE_OUTPUT', 'PASSED_ON') DEFAULT 'UNKNOWN',
msg text,
is_error TINYINT,
......
......@@ -102,7 +102,7 @@ CREATE TABLE worker (
host varchar(40) DEFAULT NULL,
process_id varchar(40) DEFAULT NULL,
work_done int(11) DEFAULT '0' NOT NULL,
status TEXT DEFAULT 'READY' NOT NULL, /* enum('READY','COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT','DEAD') DEFAULT 'READY' NOT NULL, */
status TEXT DEFAULT 'READY' NOT NULL, /* enum('READY','COMPILATION','FETCH_INPUT','RUN','WRITE_OUTPUT','DEAD') DEFAULT 'READY' NOT NULL, */
born timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_check_in datetime NOT NULL,
died datetime DEFAULT NULL,
......@@ -208,7 +208,7 @@ CREATE TABLE job (
analysis_id INTEGER NOT NULL,
input_id char(255) NOT NULL,
worker_id INTEGER DEFAULT NULL,
status TEXT DEFAULT 'READY' NOT NULL, /* enum('READY','BLOCKED','CLAIMED','COMPILATION','GET_INPUT','RUN','WRITE_OUTPUT','DONE','FAILED','PASSED_ON') DEFAULT 'READY' NOT NULL, */
status TEXT DEFAULT 'READY' NOT NULL, /* enum('READY','BLOCKED','CLAIMED','COMPILATION','FETCH_INPUT','RUN','WRITE_OUTPUT','DONE','FAILED','PASSED_ON') DEFAULT 'READY' NOT NULL, */
retry_count int(10) DEFAULT 0 NOT NULL,
completed datetime DEFAULT NULL,
runtime_msec int(10) DEFAULT NULL,
......@@ -246,7 +246,7 @@ CREATE TABLE job_message (
worker_id INTEGER NOT NULL,
time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
retry int(10) DEFAULT 0 NOT NULL,
status TEXT DEFAULT 'UNKNOWN', /* enum('UNKNOWN', 'COMPILATION', 'GET_INPUT', 'RUN', 'WRITE_OUTPUT', 'PASSED_ON') DEFAULT 'UNKNOWN', */
status TEXT DEFAULT 'UNKNOWN', /* enum('UNKNOWN', 'COMPILATION', 'FETCH_INPUT', 'RUN', 'WRITE_OUTPUT', 'PASSED_ON') DEFAULT 'UNKNOWN', */
msg TEXT,
is_error BOOLEAN
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment