line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::RecordStream::Aggregator::MapReduce; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = "4.0.25"; |
4
|
|
|
|
|
|
|
|
5
|
16
|
|
|
16
|
|
90
|
use strict; |
|
16
|
|
|
|
|
32
|
|
|
16
|
|
|
|
|
421
|
|
6
|
16
|
|
|
16
|
|
73
|
use warnings; |
|
16
|
|
|
|
|
32
|
|
|
16
|
|
|
|
|
405
|
|
7
|
|
|
|
|
|
|
|
8
|
16
|
|
|
16
|
|
74
|
use base qw(App::RecordStream::Aggregator::Aggregation); |
|
16
|
|
|
|
|
30
|
|
|
16
|
|
|
|
|
5980
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
28
|
|
|
28
|
0
|
161
|
my $class = shift; |
13
|
|
|
|
|
|
|
|
14
|
28
|
|
|
|
|
67
|
my $this = { }; |
15
|
28
|
|
|
|
|
68
|
bless $this, $class; |
16
|
|
|
|
|
|
|
|
17
|
28
|
|
|
|
|
105
|
return $this; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub initial |
21
|
|
|
|
|
|
|
{ |
22
|
137
|
|
|
137
|
0
|
674
|
return undef; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub combine |
26
|
|
|
|
|
|
|
{ |
27
|
437
|
|
|
437
|
0
|
790
|
my ($this, $cookie, $record) = @_; |
28
|
|
|
|
|
|
|
|
29
|
437
|
|
|
|
|
1044
|
my $cookie2 = $this->map($record); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# treat undef on either side as empty and return the other |
32
|
437
|
100
|
|
|
|
922
|
if(!defined($cookie)) |
33
|
|
|
|
|
|
|
{ |
34
|
140
|
|
|
|
|
454
|
return $cookie2; |
35
|
|
|
|
|
|
|
} |
36
|
297
|
50
|
|
|
|
614
|
if(!defined($cookie2)) |
37
|
|
|
|
|
|
|
{ |
38
|
0
|
|
|
|
|
0
|
return $cookie; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# if they're both non-undef then combine them |
42
|
297
|
|
|
|
|
737
|
return $this->reduce($cookie, $cookie2); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub squish |
46
|
|
|
|
|
|
|
{ |
47
|
107
|
|
|
107
|
0
|
237
|
my ($this, $cookie) = @_; |
48
|
|
|
|
|
|
|
|
49
|
107
|
|
|
|
|
216
|
return $cookie; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub map |
53
|
|
|
|
|
|
|
{ |
54
|
0
|
|
|
0
|
0
|
|
die "MapReduce subclass did not implement map.\n"; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub reduce |
58
|
|
|
|
|
|
|
{ |
59
|
0
|
|
|
0
|
0
|
|
die "MapReduce subclass did not implement reduce.\n"; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |