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
dc769b3a
Commit
dc769b3a
authored
May 21, 2014
by
Matthieu Muffato
Browse files
Queen can create a standalone worker
parent
e76e0cae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+9
-4
modules/Bio/EnsEMBL/Hive/Worker.pm
modules/Bio/EnsEMBL/Hive/Worker.pm
+4
-4
No files found.
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
dc769b3a
...
...
@@ -153,11 +153,13 @@ sub create_new_worker {
'
resource_class
'
=>
$resource_class
,
'
beekeeper_id
'
=>
$beekeeper_id
,
);
$self
->
store
(
$worker
);
my
$worker_id
=
$worker
->
dbID
;
$worker
=
$self
->
fetch_by_dbID
(
$worker_id
)
# refresh the object to get the fields initialized at SQL level (timestamps in this case)
or
die
"
Could not fetch worker with dbID=
$worker_id
";
if
(
ref
(
$self
))
{
$self
->
store
(
$worker
);
my
$worker_id
=
$worker
->
dbID
;
$worker
=
$self
->
fetch_by_dbID
(
$worker_id
)
# refresh the object to get the fields initialized at SQL level (timestamps in this case)
or
die
"
Could not fetch worker with dbID=
$worker_id
";
}
$worker
->
set_log_directory_name
(
$hive_log_dir
,
$worker_log_dir
);
...
...
@@ -470,6 +472,9 @@ sub check_for_dead_workers { # scans the whole Valley for lost Workers (but i
sub
find_previous_worker_incarnations
{
my
(
$self
,
$meadow_type
,
$meadow_name
,
$process_id
)
=
@_
;
# This happens in standalone mode, when there is no database
return
[]
unless
ref
(
$self
);
return
$self
->
fetch_all
(
"
status!='DEAD' AND meadow_type='
$meadow_type
' AND meadow_name='
$meadow_name
' AND process_id='
$process_id
'
"
);
}
...
...
modules/Bio/EnsEMBL/Hive/Worker.pm
View file @
dc769b3a
...
...
@@ -80,7 +80,7 @@ use Bio::EnsEMBL::Hive::AnalysisStats;
use
Bio::EnsEMBL::Hive::
Limiter
;
use
Bio::EnsEMBL::Hive::Utils::
RedirectStack
;
use
Bio::EnsEMBL::Hive::Utils::
Stopwatch
;
use
Bio::EnsEMBL::Hive::
Utils
('
stringify
',
'
throw
');
use
Bio::EnsEMBL::Hive::
Utils
(
'
dir_revhash
',
'
stringify
',
'
throw
');
use
base
(
'
Bio::EnsEMBL::Hive::Storable
'
);
...
...
@@ -869,8 +869,8 @@ sub set_log_directory_name {
return
unless
(
$hive_log_dir
or
$worker_log_dir
);
my
$dir_revhash
=
dir_revhash
(
$self
->
dbID
);
$worker_log_dir
||=
$hive_log_dir
.
'
/
'
.
(
$dir_revhash
?
"
$dir_revhash
/
"
:
'')
.
'
worker_id_
'
.
$self
->
dbID
;
my
$dir_revhash
=
dir_revhash
(
$self
->
dbID
//
'');
# Database-less workers are not hashed
$worker_log_dir
||=
$hive_log_dir
.
'
/
'
.
(
$dir_revhash
?
"
$dir_revhash
/
"
:
'')
.
(
$self
->
adaptor
?
'
worker_id_
'
.
$self
->
dbID
:
'
standalone/worker_pid_
'
.
$self
->
process_id
)
;
eval
{
make_path
(
$worker_log_dir
);
...
...
@@ -878,7 +878,7 @@ sub set_log_directory_name {
}
or
die
"
Could not create '
$worker_log_dir
' directory : $@
";
$self
->
log_dir
(
$worker_log_dir
);
$self
->
adaptor
->
update_log_dir
(
$self
);
# autoloaded
$self
->
adaptor
->
update_log_dir
(
$self
)
if
$self
->
adaptor
;
# autoloaded
}
...
...
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