ensembl-hive  2.7.0
LongMultServer_conf.pm
Go to the documentation of this file.
1 =pod
2 
3 =head1 NAME
4 
6 
7 =head1 SYNOPSIS
8 
9  # initialize the "server" database first and note its URL - you will need it to initialize the "client" later:
11 
12  # initialize the "client" database by plugging the server's URL:
13  init_pipeline.pl Bio::EnsEMBL::Hive::Examples::LongMult::PipeConfig::LongMultClient_conf -password <mypass> -server_url $SERVER_HIVE_URL
14 
15  # optionally also seed it with your specific values:
16  seed_pipeline.pl -url $CLIENT_HIVE_URL -logic_name take_b_apart -input_id '{ "a_multiplier" => "12345678", "b_multiplier" => "3359559666" }'
17 
18  # run the first analysis of the "Client" in order to seed the first jobs into the "Server" pipeline
19  runWorker.pl -url $CLIENT_HIVE_URL
20 
21  # run the "Server" (it will exit when all its jobs are done)
22  beekeeper.pl -url $SERVER_HIVE_URL -loop_until NO_WORK
23 
24  # run the "Client" (it will exit when all its jobs are done)
25  beekeeper.pl -url $CLIENT_HIVE_URL -loop_until NO_WORK
26 
27 =head1 DESCRIPTION
28 
29  This is the "Client" PipeConfig file of a special two-part version of the long multiplication example pipeline.
30  Please make sure you FULLY understand how the LongMult_conf works before trying this one.
31 
32  We have split the original LongMult_conf into two parts, the "Client" and the "Server" that can be used to initialize
33  two separate Hive pipeline databases.
34 
35  The "Client" kept all the original analyses and the 'final_result' table, but prefers to delegate some of the jobs on the "Server" side.
36  So the "Server" has its own 'part_multiply' to do some of the multiplication work, and its own 'add_together' and the 'final_result'
37  table to do some of the final additions.
38 
39  The link between the pipelines is established via the -server_url command line flag that is passed to the Client database.
40  Thanks to the support of cross-database semaphores we no longer need to depend on static tables, and use cross-database accumulators
41  for returning the data, whether from a local or a remote fan (in this example we have a mix).
42 
43 
44 =head1 LICENSE
45 
46  See the NOTICE file distributed with this work for additional information
47  regarding copyright ownership.
48 
49  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
50  You may obtain a copy of the License at
51 
52  http://www.apache.org/licenses/LICENSE-2.0
53 
54  Unless required by applicable law or agreed to in writing, software distributed under the License
55  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
56  See the License for the specific language governing permissions and limitations under the License.
57 
58 =head1 CONTACT
59 
60  Please subscribe to the Hive mailing list: http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users to discuss Hive-related questions or to be notified of our updates
61 
62 =cut
63 
64 
65 package Bio::EnsEMBL::Hive::Examples::LongMult::PipeConfig::LongMultServer_conf;
66 
67 use strict;
68 use warnings;
69 
70 use base ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf'); # All Hive databases configuration files should inherit from HiveGeneric, directly or indirectly
71 
72 sub pipeline_create_commands {
73  my ($self) = @_;
74  return [
75  @{$self->SUPER::pipeline_create_commands}, # inheriting database and hive tables' creation
76 
77  # additional tables needed for long multiplication pipeline's operation:
78  $self->db_cmd('CREATE TABLE final_result (a_multiplier varchar(40) NOT NULL, b_multiplier varchar(40) NOT NULL, result varchar(80) NOT NULL, PRIMARY KEY (a_multiplier, b_multiplier))'),
79  ];
80 }
81 
82 
83 sub pipeline_wide_parameters {
84  my ($self) = @_;
85  return {
86  %{$self->SUPER::pipeline_wide_parameters}, # here we inherit anything from the base class
87 
88  'take_time' => 0,
89  };
90 }
91 
92 
93 sub pipeline_analyses {
94  my ($self) = @_;
95  return [
96  # the "Server"-side fan analysis (performs multiplication by higher digits)
97  { -logic_name => 'part_multiply',
98  -module => 'Bio::EnsEMBL::Hive::Examples::LongMult::RunnableDB::PartMultiply',
99  -analysis_capacity => 4, # use per-analysis limiter
100  -flow_into => {
101  1 => '?accu_name=partial_product&accu_address={digit}&accu_input_variable=product',
102  },
103  },
104 
105  # the "Server"-side funnel:
106  { -logic_name => 'add_together',
107  -module => 'Bio::EnsEMBL::Hive::Examples::LongMult::RunnableDB::AddTogether',
108  -flow_into => {
109  1 => '?table_name=final_result',
110  },
111  },
112 
113  ];
114 }
115 
116 1;
117 
Bio::EnsEMBL::Hive::Examples::LongMult::PipeConfig::LongMultServer_conf
Definition: LongMultServer_conf.pm:47
Bio::EnsEMBL::Hive::Examples::LongMult::PipeConfig::LongMultClient_conf
Definition: LongMultClient_conf.pm:47
Bio::EnsEMBL::Hive::Version
Definition: Version.pm:19
Bio::EnsEMBL::Hive
Definition: Hive.pm:38