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
f562ba28
Commit
f562ba28
authored
Mar 25, 2014
by
Leo Gordon
Browse files
bugfix: make sure -wait_for is working properly again (do not auto-initialize Cacheable)
parent
ae3e65fd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
11 deletions
+39
-11
modules/Bio/EnsEMBL/Hive/Analysis.pm
modules/Bio/EnsEMBL/Hive/Analysis.pm
+11
-7
modules/Bio/EnsEMBL/Hive/AnalysisCtrlRule.pm
modules/Bio/EnsEMBL/Hive/AnalysisCtrlRule.pm
+3
-1
modules/Bio/EnsEMBL/Hive/Cacheable.pm
modules/Bio/EnsEMBL/Hive/Cacheable.pm
+1
-1
modules/Bio/EnsEMBL/Hive/DBSQL/DBAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/DBAdaptor.pm
+17
-0
modules/Bio/EnsEMBL/Hive/DataflowRule.pm
modules/Bio/EnsEMBL/Hive/DataflowRule.pm
+2
-1
modules/Bio/EnsEMBL/Hive/Storable.pm
modules/Bio/EnsEMBL/Hive/Storable.pm
+2
-1
scripts/generate_graph.pl
scripts/generate_graph.pl
+3
-0
No files found.
modules/Bio/EnsEMBL/Hive/Analysis.pm
View file @
f562ba28
...
...
@@ -200,8 +200,11 @@ sub display_name {
sub
stats
{
my
$self
=
shift
@_
;
return
Bio::EnsEMBL::Hive::
AnalysisStats
->
collection
()
->
find_one_by
('
analysis
',
$self
)
||
$self
->
adaptor
->
db
->
get_AnalysisStatsAdaptor
->
fetch_by_analysis_id
(
$self
->
dbID
);
my
$collection
=
Bio::EnsEMBL::Hive::
AnalysisStats
->
collection
();
return
$collection
?
$collection
->
find_one_by
('
analysis
',
$self
)
:
$self
->
adaptor
->
db
->
get_AnalysisStatsAdaptor
->
fetch_by_analysis_id
(
$self
->
dbID
);
}
...
...
@@ -217,17 +220,18 @@ sub jobs_collection {
sub
control_rules_collection
{
my
$self
=
shift
@_
;
return
Bio::EnsEMBL::Hive::
AnalysisCtrlRule
->
collection
()
->
find_all_by
('
ctrled_analysis
',
$self
)
||
$self
->
adaptor
->
db
->
get_AnalysisCtrlRuleAdaptor
->
fetch_all_by_ctrled_analysis_id
(
$self
->
dbID
);
my
$collection
=
Bio::EnsEMBL::Hive::
AnalysisCtrlRule
->
collection
();
return
$collection
?
$collection
->
find_all_by
('
ctrled_analysis
',
$self
)
:
$self
->
adaptor
->
db
->
get_AnalysisCtrlRuleAdaptor
->
fetch_all_by_ctrled_analysis_id
(
$self
->
dbID
);
}
sub
dataflow_rules_collection
{
my
$self
=
shift
@_
;
$self
->
{'
_dataflow_rules_collection
'}
=
shift
if
(
@
_
);
return
$self
->
{'
_dataflow_rules_collection
'}
||
Bio::EnsEMBL::Hive::
DataflowRule
->
collection
()
->
find_all_by
('
from_analysis
',
$self
);
return
Bio::EnsEMBL::Hive::
DataflowRule
->
collection
()
->
find_all_by
('
from_analysis
',
$self
);
}
...
...
modules/Bio/EnsEMBL/Hive/AnalysisCtrlRule.pm
View file @
f562ba28
...
...
@@ -118,7 +118,9 @@ sub condition_analysis {
# lazy load the analysis object if I can
if
(
!
$self
->
{'
_condition_analysis
'}
and
my
$condition_analysis_url
=
$self
->
condition_analysis_url
)
{
if
(
$self
->
{'
_condition_analysis
'}
=
Bio::EnsEMBL::Hive::
Analysis
->
collection
()
->
find_one_by
('
logic_name
',
$condition_analysis_url
)
)
{
my
$collection
=
Bio::EnsEMBL::Hive::
Analysis
->
collection
();
if
(
$collection
and
$self
->
{'
_condition_analysis
'}
=
$collection
->
find_one_by
('
logic_name
',
$condition_analysis_url
)
)
{
# warn "Lazy-loading object from 'Analysis' collection\n";
}
elsif
(
my
$adaptor
=
$self
->
adaptor
)
{
# warn "Lazy-loading object from AnalysisAdaptor\n";
...
...
modules/Bio/EnsEMBL/Hive/Cacheable.pm
View file @
f562ba28
...
...
@@ -13,7 +13,7 @@ sub collection {
$cache_by_class
{
$class
}
=
shift
@_
;
}
return
$cache_by_class
{
$class
}
||=
Bio::EnsEMBL::Hive::Utils::
Collection
->
new
()
;
return
$cache_by_class
{
$class
};
}
...
...
modules/Bio/EnsEMBL/Hive/DBSQL/DBAdaptor.pm
View file @
f562ba28
...
...
@@ -41,6 +41,10 @@ use Bio::EnsEMBL::Hive::DBSQL::DBConnection;
use
Bio::EnsEMBL::Hive::DBSQL::
SqlSchemaAdaptor
;
use
Bio::EnsEMBL::Hive::
Utils
('
throw
');
use
Bio::EnsEMBL::Hive::Utils::
Collection
;
use
Bio::EnsEMBL::Hive::
ResourceClass
;
use
Bio::EnsEMBL::Hive::
ResourceDescription
;
use
Bio::EnsEMBL::Hive::
Analysis
;
use
Bio::EnsEMBL::Hive::
AnalysisStats
;
sub
new
{
...
...
@@ -256,6 +260,19 @@ sub AUTOLOAD {
}
sub
init_collections
{
# should not really belong to DBAdaptor, temporarily squatting here...
foreach
my
$AdaptorType
('
Meta
',
'
PipelineWideParameters
')
{
Bio::EnsEMBL::
Hive
->
collection
(
$AdaptorType
,
{}
);
}
foreach
my
$AdaptorType
('
ResourceClass
',
'
ResourceDescription
',
'
Analysis
',
'
AnalysisStats
',
'
AnalysisCtrlRule
',
'
DataflowRule
')
{
my
$class
=
'
Bio::EnsEMBL::Hive::
'
.
$AdaptorType
;
$class
->
collection
(
Bio::EnsEMBL::Hive::Utils::
Collection
->
new
()
);
}
}
sub
load_collections
{
my
$self
=
shift
@_
;
...
...
modules/Bio/EnsEMBL/Hive/DataflowRule.pm
View file @
f562ba28
...
...
@@ -160,8 +160,9 @@ sub to_analysis {
# lazy load the analysis object if I can
if
(
!
$self
->
{'
_to_analysis
'}
and
my
$to_analysis_url
=
$self
->
to_analysis_url
)
{
my
$collection
=
Bio::EnsEMBL::Hive::
Analysis
->
collection
();
if
(
$self
->
{'
_to_analysis
'}
=
Bio::EnsEMBL::Hive::
Analysis
->
collection
()
->
find_one_by
('
logic_name
',
$to_analysis_url
)
)
{
if
(
$collection
and
$self
->
{'
_to_analysis
'}
=
$
collection
->
find_one_by
('
logic_name
',
$to_analysis_url
)
)
{
# warn "Lazy-loading object from 'Analysis' collection\n";
}
elsif
(
my
$adaptor
=
$self
->
adaptor
)
{
# warn "Lazy-loading object from AnalysisAdaptor\n";
...
...
modules/Bio/EnsEMBL/Hive/Storable.pm
View file @
f562ba28
...
...
@@ -156,7 +156,8 @@ sub AUTOLOAD {
# attempt to lazy-load:
}
elsif
(
!
$self
->
{
$foo_obj_method_name
}
and
my
$foo_object_id
=
$self
->
{
$foo_id_method_name
})
{
my
$foo_class
=
'
Bio::EnsEMBL::Hive::
'
.
$AdaptorType
;
if
(
$self
->
{
$foo_obj_method_name
}
=
$foo_class
->
collection
()
->
find_one_by
('
dbID
',
$foo_object_id
)
)
{
# careful: $AdaptorType may not be unique (aliases)
my
$collection
=
$foo_class
->
collection
();
if
(
$collection
and
$self
->
{
$foo_obj_method_name
}
=
$collection
->
find_one_by
('
dbID
',
$foo_object_id
)
)
{
# careful: $AdaptorType may not be unique (aliases)
# warn "Lazy-loading object from $AdaptorType collection\n";
}
elsif
(
my
$adaptor
=
$self
->
adaptor
)
{
# warn "Lazy-loading object from $AdaptorType adaptor\n";
...
...
scripts/generate_graph.pl
View file @
f562ba28
...
...
@@ -72,6 +72,9 @@ sub main {
);
$self
->
{'
dba
'}
->
load_collections
();
}
else
{
Bio::EnsEMBL::Hive::DBSQL::
DBAdaptor
->
init_collections
();
}
if
(
$self
->
{'
pipeconfig
'})
{
...
...
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