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