Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
ddbb2ad2
Commit
ddbb2ad2
authored
Feb 23, 2005
by
Jessica Severin
Browse files
fixed job reset/claim logic and API. Works better for debugging.
parent
1e5ff11e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
19 deletions
+34
-19
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+33
-18
modules/Bio/EnsEMBL/Hive/Worker.pm
modules/Bio/EnsEMBL/Hive/Worker.pm
+1
-1
No files found.
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
ddbb2ad2
...
...
@@ -227,38 +227,47 @@ sub worker_grab_jobs {
return
$jobs
;
}
=head2 grab_job_by_dbID
=head2 reset_and_fetch_job_by_dbID
Arg [1]: int $analysis_job_id
Example:
my $job = $queen->
grab
_job_by_dbID($analysis_job_id);
my $job = $queen->
reset_and_fetch
_job_by_dbID($analysis_job_id);
Description:
For the specified analysis_job_id it will fetch just that job,
reclaim it and return it. Specifying a specific job bypasses
the safety checks, thus multiple workers could be running the
reset it completely as if it has never run, and return it.
Specifying a specific job bypasses the safety checks,
thus multiple workers could be running the
same job simultaneously (use only for debugging).
Returntype :
Bio::EnsEMBL::Hive::AnalysisJob object
s
Bio::EnsEMBL::Hive::AnalysisJob object
Exceptions :
Caller :
Caller :
beekeepers, runWorker.pl scripts
=cut
sub
grab
_job_by_dbID
{
my
$self
=
shift
;
sub
reset_and_fetch
_job_by_dbID
{
my
$self
=
shift
;
my
$analysis_job_id
=
shift
;
return
undef
unless
(
$analysis_job_id
);
my
$jobDBA
=
$self
->
db
->
get_AnalysisJobAdaptor
;
printf
("
fetching job for id
",
$analysis_job_id
,
"
\n
");
my
$job
=
$jobDBA
->
fetch_by_dbID
(
$analysis_job_id
);
return
undef
unless
(
$job
);
$jobDBA
->
reset_job_by_dbID
(
$analysis_job_id
);
my
$job
=
$jobDBA
->
fetch_by_dbID
(
$analysis_job_id
);
my
$stats
=
$self
->
db
->
get_AnalysisStatsAdaptor
->
fetch_by_analysis_id
(
$job
->
analysis_id
);
$self
->
synchronize_AnalysisStats
(
$stats
);
$job
->
hive_id
(
0
);
$jobDBA
->
reclaim_job
(
$job
);
$self
->
db
->
get_AnalysisStatsAdaptor
->
update_status
(
$job
->
analysis_id
,
'
LOADING
');
return
$job
;
}
sub
worker_reclaim_job
{
my
$self
=
shift
;
my
$worker
=
shift
;
my
$job
=
shift
;
return
undef
unless
(
$job
and
$worker
);
$job
->
hive_id
(
$worker
->
hive_id
);
$self
->
db
->
get_AnalysisJobAdaptor
->
reclaim_job
(
$job
);
return
$job
;
}
...
...
@@ -303,6 +312,12 @@ sub fetch_overdue_workers {
return
$self
->
_generic_fetch
(
$constraint
);
}
sub
fetch_failed_workers
{
my
$self
=
shift
;
my
$constraint
=
"
h.cause_of_death='FATALITY'
";
return
$self
->
_generic_fetch
(
$constraint
);
}
=head2 synchronize_hive
...
...
modules/Bio/EnsEMBL/Hive/Worker.pm
View file @
ddbb2ad2
...
...
@@ -372,7 +372,7 @@ sub run
my
$jobs
=
[]
;
if
(
$specific_job
)
{
$s
pecific_job
->
hive_id
(
$self
->
hive_id
);
$s
elf
->
queen
->
worker_reclaim_job
(
$self
,
$specific_job
);
push
@$jobs
,
$specific_job
;
}
else
{
$jobs
=
$self
->
queen
->
worker_grab_jobs
(
$self
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment