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
ced91fa6
Commit
ced91fa6
authored
Jun 08, 2004
by
Jessica Severin
Browse files
added method AnalysisStats::determine_status instead of hard coding
this logic into the Queen
parent
98eb2e34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
15 deletions
+30
-15
modules/Bio/EnsEMBL/Hive/AnalysisStats.pm
modules/Bio/EnsEMBL/Hive/AnalysisStats.pm
+25
-0
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+4
-14
No files found.
modules/Bio/EnsEMBL/Hive/AnalysisStats.pm
View file @
ced91fa6
...
...
@@ -58,6 +58,12 @@ sub adaptor {
return
$self
->
{'
_adaptor
'};
}
sub
update
{
my
$self
=
shift
;
return
unless
(
$self
->
adaptor
);
$self
->
adaptor
->
update
(
$self
);
}
sub
analysis_id
{
my
$self
=
shift
;
$self
->
{'
_analysis_id
'}
=
shift
if
(
@
_
);
...
...
@@ -115,6 +121,25 @@ sub seconds_since_last_update {
return
time
()
-
$self
->
{'
_last_update
'};
}
sub
determine_status
{
my
$self
=
shift
;
if
(
$self
->
status
ne
'
BLOCKED
')
{
if
(
$self
->
done_job_count
>
0
and
$self
->
total_job_count
==
$self
->
done_job_count
)
{
$self
->
status
('
DONE
');
}
if
(
$self
->
total_job_count
==
$self
->
unclaimed_job_count
)
{
$self
->
status
('
READY
');
}
if
(
$self
->
unclaimed_job_count
>
0
and
$self
->
total_job_count
>
$self
->
unclaimed_job_count
)
{
$self
->
status
('
WORKING
');
}
}
return
$self
;
}
sub
print_stats
{
my
$self
=
shift
;
print
("
ANALYSIS_STATS: analysis_id=
",
$self
->
analysis_id
,"
\n
"
...
...
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm
View file @
ced91fa6
...
...
@@ -261,7 +261,7 @@ sub _final_clause {
sub
update
{
my
(
$self
,
$stats
)
=
@_
;
my
$sql
=
"
UPDATE analysis_stats SET status='
"
.
$stats
->
status
.
"
'
";
$sql
.=
"
,batch_size=
"
.
$stats
->
batch_size
();
$sql
.=
"
,hive_capacity=
"
.
$stats
->
hive_capacity
();
...
...
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
ced91fa6
...
...
@@ -188,19 +188,7 @@ sub update_analysis_stats {
$sth
->
execute
();
while
(
my
(
$analysis_id
,
$status
,
$count
)
=
$sth
->
fetchrow_array
())
{
unless
(
defined
(
$analysisStats
)
and
$analysisStats
->
analysis_id
==
$analysis_id
)
{
if
(
$analysisStats
and
(
$analysisStats
->
status
ne
'
BLOCKED
'))
{
if
(
$analysisStats
->
total_job_count
==
$analysisStats
->
done_job_count
)
{
$analysisStats
->
status
('
DONE
');
}
if
(
$analysisStats
->
total_job_count
==
$analysisStats
->
unclaimed_job_count
)
{
$analysisStats
->
status
('
READY
');
}
if
(
$analysisStats
->
unclaimed_job_count
>
0
and
$analysisStats
->
total_job_count
>
$analysisStats
->
unclaimed_job_count
)
{
$analysisStats
->
status
('
WORKING
');
}
$statsDBA
->
update
(
$analysisStats
);
}
$analysisStats
->
determine_status
->
update
()
if
(
$analysisStats
);
$analysisStats
=
$statsDBA
->
fetch_by_analysis_id
(
$analysis_id
);
$analysisStats
->
total_job_count
(
0
);
...
...
@@ -215,13 +203,15 @@ sub update_analysis_stats {
if
(
$status
eq
'
READY
')
{
$analysisStats
->
unclaimed_job_count
(
$count
);
my
$numWorkers
=
$count
/
$analysisStats
->
batch_size
;
if
(
$numWorkers
>
$analysisStats
->
hive_capacity
)
{
if
(
$analysisStats
->
hive_capacity
>
0
and
$numWorkers
>
$analysisStats
->
hive_capacity
)
{
$numWorkers
=
$analysisStats
->
hive_capacity
;
}
$analysisStats
->
num_required_workers
(
$numWorkers
);
}
if
(
$status
eq
'
DONE
')
{
$analysisStats
->
done_job_count
(
$count
);
}
}
$analysisStats
->
determine_status
->
update
()
if
(
$analysisStats
);
$sth
->
finish
;
}
...
...
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