« blib/lib/App/RecordStream/Aggregator/Last.pm
↑ Summary
blib/lib/App/RecordStream/Aggregator/Sum.pm »
| 1 | package App::RecordStream::Aggregator::MapReduce::FieldSet; | ||
| 2 | |||
| 3 | 9 | our $VERSION = "4.0.23"; | |
| 4 | |||
| 5 | 9 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 9 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 9 | ▶ | use App::RecordStream::Aggregator::MapReduce; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 9 | ▶ | use App::RecordStream::DomainLanguage::Valuation::KeySpec; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 9 | ▶ | use base 'App::RecordStream::Aggregator::MapReduce'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | sub new | ||
| 14 | { | ||
| 15 | 5 | ▶ | my $class = shift; |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 16 | 5 | my @fields = @_; | |
| 17 | |||
| 18 | 5 | return new_from_valuation($class, map { App::RecordStream::DomainLanguage::Valuation::KeySpec->new($_) } @fields); | |
| 19 | } | ||
| 20 | |||
| 21 | sub new_from_valuation | ||
| 22 | { | ||
| 23 | 13 | ▶ | my $class = shift; |
|
Subroutine
new_from_valuation: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 24 | 13 | my @valuations = @_; | |
| 25 | |||
| 26 | 13 | my $this = | |
| 27 | { | ||
| 28 | 'valuations' => \@valuations, | ||
| 29 | }; | ||
| 30 | 13 | bless $this, $class; | |
| 31 | |||
| 32 | 13 | return $this; | |
| 33 | } | ||
| 34 | |||
| 35 | sub map | ||
| 36 | { | ||
| 37 | 85 | ▶ | my ($this, $record) = @_; |
|
Subroutine
map: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 38 | |||
| 39 | 85 | return $this->map_fields(map { $_->evaluate_record($record) } @{$this->{'valuations'}}); | |
| 40 | } | ||
| 41 | |||
| 42 | sub map_fields | ||
| 43 | { | ||
| 44 | 0 | ▶ | die "FieldSet subclass does not implement map_fields\n"; |
|
Subroutine
map_fields: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 45 | } | ||
| 46 | |||
| 47 | 9 | 1; | |