line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::MasterData::Declare::Runner; |
2
|
4
|
|
|
4
|
|
106
|
use 5.010001; |
|
4
|
|
|
|
|
18
|
|
3
|
4
|
|
|
4
|
|
26
|
use strict; |
|
4
|
|
|
|
|
29
|
|
|
4
|
|
|
|
|
116
|
|
4
|
4
|
|
|
4
|
|
43
|
use warnings; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
138
|
|
5
|
4
|
|
|
4
|
|
39
|
use utf8; |
|
4
|
|
|
|
|
19
|
|
|
4
|
|
|
|
|
31
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
8
|
4
|
|
|
|
|
53
|
new => 1, |
9
|
|
|
|
|
|
|
rw => [qw/bucket/], |
10
|
|
|
|
|
|
|
ro => [qw/code/], |
11
|
4
|
|
|
4
|
|
1610
|
); |
|
4
|
|
|
|
|
5840
|
|
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
594
|
use Carp qw/croak/; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
1107
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub run { |
16
|
3
|
|
|
3
|
0
|
9
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
14
|
$self->code->(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub add_reader_to_bucket { |
22
|
5
|
|
|
5
|
0
|
26
|
my ($self, $reader) = @_; |
23
|
|
|
|
|
|
|
|
24
|
5
|
100
|
|
|
|
29
|
$self->bucket({}) unless $self->bucket; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# TODO: merge reader |
27
|
5
|
|
|
|
|
78
|
$self->bucket->{$reader->table_name} = $reader; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub rows { |
31
|
7
|
|
|
7
|
0
|
30
|
my ($self, $table_name) = @_; |
32
|
|
|
|
|
|
|
|
33
|
7
|
50
|
33
|
|
|
44
|
if (!defined $self->bucket || !exists $self->bucket->{$table_name}) { |
34
|
0
|
|
|
|
|
0
|
croak "$table_name is not exists."; |
35
|
|
|
|
|
|
|
} |
36
|
7
|
|
|
|
|
135
|
my $reader = $self->bucket->{$table_name}; |
37
|
7
|
|
|
|
|
69
|
my $rows = $reader->rows; |
38
|
7
|
|
|
|
|
79
|
return $rows; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |