| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Class::DBI::Replicated::Test; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1397
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
31
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
25
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use Class::Trigger; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Class::DBI::Replicated::Test |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _mk_output { |
|
14
|
0
|
|
|
0
|
|
|
my $text = shift; |
|
15
|
|
|
|
|
|
|
return sub { |
|
16
|
0
|
|
|
0
|
|
|
my $class = shift; |
|
17
|
0
|
|
|
|
|
|
my $tmp = $text; |
|
18
|
0
|
0
|
|
|
|
|
$tmp .= " @_" if @_; |
|
19
|
0
|
0
|
|
|
|
|
return unless $class->repl_output; |
|
20
|
0
|
|
|
|
|
|
push @{$class->repl_output}, $tmp; |
|
|
0
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
}; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _mk_trigger { |
|
25
|
0
|
|
|
0
|
|
|
my ($class, $name) = @_; |
|
26
|
0
|
|
|
|
|
|
$class->add_trigger( |
|
27
|
|
|
|
|
|
|
$name => _mk_output($name), |
|
28
|
|
|
|
|
|
|
); |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _test_init { |
|
32
|
0
|
|
|
0
|
|
|
my ($class) = @_; |
|
33
|
0
|
|
|
|
|
|
$class->mk_class_accessors('repl_output'); |
|
34
|
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
for (qw( |
|
36
|
|
|
|
|
|
|
switch_to_master |
|
37
|
|
|
|
|
|
|
switch_to_slave |
|
38
|
|
|
|
|
|
|
repl_db |
|
39
|
|
|
|
|
|
|
repl_check |
|
40
|
|
|
|
|
|
|
repl_mark |
|
41
|
|
|
|
|
|
|
)) { |
|
42
|
0
|
|
|
|
|
|
$class->_mk_trigger($_); |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |