Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
7eb40a96
Commit
7eb40a96
authored
Jun 08, 2004
by
Jessica Severin
Browse files
changed method from dbID to analysis_id to make it clearer that these
are bound to analysis rather than being distinct
parent
0e34c22b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
20 deletions
+16
-20
modules/Bio/EnsEMBL/Hive/AnalysisStats.pm
modules/Bio/EnsEMBL/Hive/AnalysisStats.pm
+5
-5
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm
+11
-15
No files found.
modules/Bio/EnsEMBL/Hive/AnalysisStats.pm
View file @
7eb40a96
...
...
@@ -58,10 +58,10 @@ sub adaptor {
return
$self
->
{'
_adaptor
'};
}
sub
dbID
{
sub
analysis_id
{
my
$self
=
shift
;
$self
->
{'
_
dbID
'}
=
shift
if
(
@
_
);
return
$self
->
{'
_
dbID
'};
$self
->
{'
_
analysis_id
'}
=
shift
if
(
@
_
);
return
$self
->
{'
_
analysis_id
'};
}
sub
status
{
...
...
@@ -69,7 +69,7 @@ sub status {
if
(
defined
$value
)
{
$self
->
{'
_status
'}
=
$value
;
$self
->
adaptor
->
update_status
(
$self
->
dbID
,
$value
)
if
(
$self
->
adaptor
);
$self
->
adaptor
->
update_status
(
$self
->
analysis_id
,
$value
)
if
(
$self
->
adaptor
);
}
return
$self
->
{'
_status
'};
}
...
...
@@ -118,7 +118,7 @@ sub seconds_since_last_update {
sub
print_stats
{
my
$self
=
shift
;
print
("
ANALYSIS_STATS: analysis_id=
",
$self
->
dbID
,"
\n
"
print
("
ANALYSIS_STATS: analysis_id=
",
$self
->
analysis_id
,"
\n
"
,"
status=
",
$self
->
status
,"
\n
"
,"
batch_size=
",
$self
->
batch_size
,"
\n
"
,"
hive_capacity=
"
.
$self
->
hive_capacity
(),"
\n
"
...
...
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm
View file @
7eb40a96
...
...
@@ -10,27 +10,23 @@
# POD documentation - main docs before the code
=head1 NAME
Bio::EnsEMBL::Hive::DBSQL::AnalysisStatsAdaptor
Bio::EnsEMBL::Hive::DBSQL::AnalysisStatsAdaptor
=head1 SYNOPSIS
$analysisStatsAdaptor = $db_adaptor->get_AnalysisStatsAdaptor;
$analysisStatsAdaptor = $analysisStats->adaptor;
=head1 DESCRIPTION
Module to encapsulate all db access for persistent class AnalysisStats.
There should be just one per application and database connection.
=head1 CONTACT
Contact Jessica Severin on implemetation/design detail: jessica@ebi.ac.uk
Contact Ewan Birney on EnsEMBL in general: birney@sanger.ac.uk
Contact Jessica Severin on implemetation/design detail: jessica@ebi.ac.uk
Contact Ewan Birney on EnsEMBL in general: birney@sanger.ac.uk
=head1 APPENDIX
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _
=cut
...
...
@@ -46,11 +42,11 @@ use Bio::EnsEMBL::DBSQL::BaseAdaptor;
our
@ISA
=
qw(Bio::EnsEMBL::DBSQL::BaseAdaptor)
;
=head2 fetch_by_
dbID
=head2 fetch_by_
analysis_id
Arg [1] : int $id
the unique database identifier for the feature to be obtained
Example : $feat = $adaptor->fetch_by_
dbID
(1234);
Example : $feat = $adaptor->fetch_by_
analysis_id
(1234);
Description: Returns the feature created from the database defined by the
the id $id.
Returntype : Bio::EnsEMBL::Hive::AnalysisStats
...
...
@@ -59,11 +55,11 @@ our @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
=cut
sub
fetch_by_
dbID
{
sub
fetch_by_
analysis_id
{
my
(
$self
,
$id
)
=
@_
;
unless
(
defined
$id
)
{
$self
->
throw
("
fetch_by_
dbID
must have an id
");
$self
->
throw
("
fetch_by_
analysis_id
must have an id
");
}
my
$constraint
=
"
ast.analysis_id =
$id
";
...
...
@@ -218,7 +214,7 @@ sub _objs_from_sth {
while
(
$sth
->
fetch
())
{
my
$analStats
=
new
Bio::EnsEMBL::Hive::
AnalysisStats
;
$analStats
->
dbID
(
$column
{'
analysis_id
'});
$analStats
->
analysis_id
(
$column
{'
analysis_id
'});
$analStats
->
status
(
$column
{'
status
'});
$analStats
->
batch_size
(
$column
{'
batch_size
'});
$analStats
->
hive_capacity
(
$column
{'
hive_capacity
'});
...
...
@@ -274,7 +270,7 @@ sub update {
$sql
.=
"
,done_job_count=
"
.
$stats
->
done_job_count
();
$sql
.=
"
,num_required_workers=
"
.
$stats
->
num_required_workers
();
$sql
.=
"
,last_update=NOW()
";
$sql
.=
"
WHERE analysis_id='
"
.
$stats
->
dbID
.
"
'
";
$sql
.=
"
WHERE analysis_id='
"
.
$stats
->
analysis_id
.
"
'
";
my
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
();
...
...
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