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
60f1d5e5
Commit
60f1d5e5
authored
May 22, 2012
by
Leo Gordon
Browse files
untangling a bit. Queen does not need to re-sync and beekeeper does not need to fetch
parent
2af05379
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
19 deletions
+18
-19
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+17
-18
scripts/beekeeper.pl
scripts/beekeeper.pl
+1
-1
No files found.
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
60f1d5e5
...
...
@@ -141,8 +141,11 @@ sub create_new_worker {
if
(
$analysis_id
)
{
die
"
When you specify -job_id, please omit both -logic_name and -analysis_id to avoid confusion
\n
";
}
else
{
print
"
fetching job for job_id '
$job_id
'
\n
";
if
(
$job
=
$self
->
reset_and_fetch_job_by_dbID
(
$job_id
))
{
print
"
resetting and fetching job for job_id '
$job_id
'
\n
";
my
$job_adaptor
=
$self
->
db
->
get_AnalysisJobAdaptor
;
$job_adaptor
->
reset_job_by_dbID
(
$job_id
);
if
(
$job
=
$job_adaptor
->
fetch_by_dbID
(
$job_id
))
{
$analysis_id
=
$job
->
analysis_id
;
}
else
{
die
"
job_id '
$job_id
' could not be fetched from the database
\n
";
...
...
@@ -350,36 +353,32 @@ sub check_in_worker {
}
=head2 reset_
and_fetch_
job_by_dbID
=head2 reset_job_by_dbID
_and_sync
Arg [1]: int $job_id
Example:
my $job = $queen->reset_
and_fetch_
job_by_dbID($job_id);
my $job = $queen->reset_job_by_dbID
_and_sync
($job_id);
Description:
For the specified job_id it will fetch just that job,
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
Returntype : none
Exceptions :
Caller : beekeeper
s, runWorker.pl scripts
Caller : beekeeper
.pl
=cut
sub
reset_and_fetch_job_by_dbID
{
my
$self
=
shift
;
my
$job_id
=
shift
;
my
$jobDBA
=
$self
->
db
->
get_AnalysisJobAdaptor
;
$jobDBA
->
reset_job_by_dbID
(
$job_id
);
sub
reset_job_by_dbID_and_sync
{
my
(
$self
,
$job_id
)
=
@_
;
my
$job
=
$jobDBA
->
fetch_by_dbID
(
$job_id
);
my
$stats
=
$self
->
db
->
get_AnalysisStatsAdaptor
->
fetch_by_analysis_id
(
$job
->
analysis_id
);
$self
->
synchronize_AnalysisStats
(
$stats
);
return
$job
;
my
$job_adaptor
=
$self
->
db
->
get_AnalysisJobAdaptor
;
$job_adaptor
->
reset_job_by_dbID
(
$job_id
);
my
$job
=
$job_adaptor
->
fetch_by_dbID
(
$job_id
);
my
$stats
=
$self
->
db
->
get_AnalysisStatsAdaptor
->
fetch_by_analysis_id
(
$job
->
analysis_id
);
$self
->
synchronize_AnalysisStats
(
$stats
);
}
...
...
scripts/beekeeper.pl
View file @
60f1d5e5
...
...
@@ -186,7 +186,7 @@ sub main {
}
$current_meadow
->
submit_workers_max
(
$submit_workers_max
);
if
(
$reset_job_id
)
{
$queen
->
reset_
and_fetch_
job_by_dbID
(
$reset_job_id
);
}
if
(
$reset_job_id
)
{
$queen
->
reset_job_by_dbID
_and_sync
(
$reset_job_id
);
}
if
(
$job_id_for_output
)
{
printf
("
===== job output
\n
");
...
...
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