9 # initialize the "server" database first and note its URL - you will need it to initialize the "client" later:
12 # initialize the "client" database by plugging the server's URL:
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" }'
18 # run the "server" (it will have to be stopped manually when the "client" is done):
19 beekeeper.pl -url $SERVER_HIVE_URL -keep_alive
21 # run the "client" (it will exit by itself):
22 beekeeper.pl -url $CLIENT_HIVE_URL -loop
26 This is the
"client" PipeConfig file of a special two-part version of the
long multiplication example pipeline.
27 Please make sure you FULLY understand how the LongMult_conf works before trying
this one.
29 We have split the original LongMult_conf into two parts, the
"client" and the
"server" that can be used to initialize
30 two separate Hive pipeline databases.
32 The
"client" kept
'take_apart' and
'add_together' analyses and the
'final_result' table, but the
'part_multpily' analysis
33 has been outsourced into the
"server" which also maintains its local
'intermediate_result' table.
35 There are 3 links between the pipelines, all established from the
"client" side (the
"server" doesn
't know about them) :
36 1. The "client" seeds the "server" via a cross-database dataflow rule ('take_b_apart
'#2 -> 'part_multiply)
37 2. The
"client" waits
for the
'part_multiply' analysis to complete on the
"server" via an analysis_ctrl_rule
38 3. The
"client" reads the data from the
'intermediate_result' table of the
"server"
42 See the NOTICE file distributed with
this work
for additional information
43 regarding copyright ownership.
45 Licensed under the Apache License, Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
46 You may obtain a copy of the License at
50 Unless required by applicable law or agreed to in writing, software distributed under the License
51 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
52 See the License
for the specific language governing permissions and limitations under the License.
56 Please subscribe to the Hive mailing list: http:
61 package Bio::EnsEMBL::Hive::Examples::LongMult::PipeConfig::LongMultWfClient_conf;
66 use base (
'Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf'); # All Hive databases configuration files should inherit from HiveGeneric, directly or indirectly
70 =head2 pipeline_create_commands
73 In addition to the standard creation of the database and populating it with Hive tables and procedures it also creates two pipeline-specific tables used by Runnables to communicate.
77 sub pipeline_create_commands {
80 @{$self->SUPER::pipeline_create_commands}, # inheriting database and hive tables
' creation
82 # additional tables needed for long multiplication pipeline's operation:
83 $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))'),
88 =head2 pipeline_wide_parameters
90 Description : Interface method that should
return a hash of pipeline_wide_parameter_name->pipeline_wide_parameter_value pairs.
91 The value doesn
't have to be a scalar, can be any Perl structure now (will be stringified and de-stringified automagically).
92 Please see existing PipeConfig modules for examples.
96 sub pipeline_wide_parameters {
99 %{$self->SUPER::pipeline_wide_parameters}, # here we inherit anything from the base class
106 sub pipeline_analyses {
109 { -logic_name => 'take_b_apart
',
111 -meadow_type=> 'LOCAL
', # do not bother the farm with such a simple task (and get it done faster)
112 -analysis_capacity => 2, # use per-analysis limiter
114 { 'a_multiplier
' => '9650156169
', 'b_multiplier
' => '327358788
' },
115 { 'a_multiplier
' => '327358788
', 'b_multiplier
' => '9650156169
' },
118 # A WHEN block is not a hash, so multiple occurences of each condition (including ELSE) are permitted.
120 '#digit#>1
' => { $self->o('server_url
').'?logic_name=part_multiply
' => INPUT_PLUS( {'digit
' => '#digit#
', 'take_time
' => '#take_time#
'} ) },
122 1 => [ 'add_together
' ],
127 # 'take_b_apart
' seeds an externally looping "server" pipeline which will put results into its local 'intermediate_result
' table and unblock 'add_together
'
130 { -logic_name => 'add_together
',
133 'intermediate_table_url
' => $self->o('server_url
').'?table_name=intermediate_result
',
135 -wait_for => [ $self->o('server_url
').'?logic_name=part_multiply
' ],
137 1 => [ '?table_name=final_result
' ],