9 A data container
object that defines parameters
for accumulated dataflow.
10 This
object is generated from specially designed datalow URLs.
14 Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
15 Copyright [2016-2022] EMBL-European Bioinformatics Institute
17 Licensed under the Apache License,
Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
18 You may obtain a copy of the License at
22 Unless required by applicable law or agreed to in writing, software distributed under the License
23 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 See the License
for the specific language governing permissions and limitations under the License.
28 Please subscribe to the
Hive mailing list: http:
33 package Bio::EnsEMBL::Hive::Accumulator;
40 use base (
'Bio::EnsEMBL::Hive::Storable' );
43 sub unikey { #
override the
default from
Cacheable parent
44 return [
'accu_name',
'accu_address',
'accu_input_variable' ];
52 $self->{
'_accu_name'} = shift @_;
54 return $self->{
'_accu_name'};
62 $self->{
'_accu_address'} = shift @_;
64 return ( $self->{
'_accu_address'}
68 sub accu_input_variable {
72 $self->{
'_accu_input_variable'} = shift @_;
74 return ( $self->{
'_accu_input_variable'}
78 sub url_query_params {
81 return { # direct access to the actual (possibly missing) values
82 'accu_name' => $self->accu_name,
83 'accu_address' => $self->{
'_accu_address'},
84 'accu_input_variable' => $self->{
'_accu_input_variable'},
91 return $self->accu_name
94 . $self->accu_input_variable;
99 my ( $self, $output_ids, $emitting_job ) = @_;
101 if(my $receiving_semaphore = $emitting_job->controlled_semaphore) {
103 my $sending_job_id = $emitting_job->dbID;
104 my $receiving_semaphore_id = $receiving_semaphore->dbID;
105 my $accu_adaptor = $receiving_semaphore->adaptor->db->get_AccumulatorAdaptor;
107 my $accu_name = $self->accu_name;
108 my $accu_address = $self->accu_address;
109 my $accu_input_variable = $self->accu_input_variable;
113 foreach my $output_id (@$output_ids) {
115 my $key_signature = $accu_address;
116 $key_signature=~s/(\w+)/$emitting_job->_param_possibly_overridden($1,$output_id)/eg;
119 'sending_job_id' => $sending_job_id,
120 'receiving_semaphore_id' => $receiving_semaphore_id,
121 'struct_name' => $accu_name,
122 'key_signature' => $key_signature,
123 'value' => stringify( $emitting_job->_param_possibly_overridden($accu_input_variable, $output_id) ),
127 $accu_adaptor->store( \@rows );
130 die
"No controlled semaphore, cannot perform accumulated dataflow";
138 return 'Accumulator(' . $self->display_name .
')';