9 $dba->get_AccumulatorAdaptor->
store( \@rows );
13 This is currently an
"objectless" adaptor
for building accumulated structures.
17 See the NOTICE file distributed with
this work
for additional information
18 regarding copyright ownership.
20 Licensed under the Apache License, Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
21 You may obtain a copy of the License at
25 Unless required by applicable law or agreed to in writing, software distributed under the License
26 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27 See the License
for the specific language governing permissions and limitations under the License.
31 Please subscribe to the Hive mailing list: http:
36 package Bio::EnsEMBL::Hive::DBSQL::AccumulatorAdaptor;
43 use base (
'Bio::EnsEMBL::Hive::DBSQL::NakedTableAdaptor');
46 sub default_table_name {
51 sub fetch_structures_for_job_ids {
52 my ($self, $job_ids_csv, $id_scale, $id_offset) = @_;
60 my $sql =
"SELECT s.dependent_job_id, a.struct_name, a.key_signature, a.value FROM accu a JOIN semaphore s ON (s.semaphore_id=a.receiving_semaphore_id) WHERE s.dependent_job_id in ($job_ids_csv)";
61 my $sth = $self->prepare( $sql );
64 ROW:
while(my ($receiving_job_id, $struct_name, $key_signature, $stringified_value) = $sth->fetchrow_array() ) {
66 my $value = destringify($stringified_value);
68 my $sptr = \$structures{$receiving_job_id * $id_scale + $id_offset}{$struct_name};
70 while( $key_signature=~/(?:(?:\[(\d*)\])|(?:\{(.*?)\}))/g) {
71 my ($array_index, $hash_key) = ($1, $2);
72 if(defined($array_index)) {
73 unless(length($array_index)) {
74 $array_index = scalar(@{$$sptr||[]});
76 $sptr = \$$sptr->[$array_index];
77 } elsif(defined($hash_key)) {
78 if(length($hash_key)) {
79 $sptr = \$$sptr->{$hash_key};
81 $sptr = \$$sptr->{$value};