File Coverage

blib/lib/Hadoop/Streaming/Mapper.pm
Criterion Covered Total %
statement 6 11 54.5
branch n/a
condition n/a
subroutine 2 3 66.6
pod 1 1 100.0
total 9 15 60.0


line stmt bran cond sub pod time code
1             package Hadoop::Streaming::Mapper;
2             $Hadoop::Streaming::Mapper::VERSION = '0.143060';
3 1     1   15177 use Moo::Role;
  1         15648  
  1         5  
4 1     1   792 use IO::Handle;
  1         4991  
  1         109  
5              
6             with 'Hadoop::Streaming::Role::Emitter';
7             #requires qw(emit counter status); #from Hadoop::Streaming::Role::Emitter
8             requires qw(map); # from consumer
9              
10             # ABSTRACT: Simplify writing Hadoop Streaming Mapper jobs. Write a map() function and let this role handle the Stream interface.
11              
12              
13              
14              
15             sub run
16             {
17 0     0 1   my $class = shift;
18 0           my $self = $class->new;
19              
20 0           while ( my $line = STDIN->getline )
21             {
22 0           chomp $line;
23 0           $self->map($line);
24             }
25             }
26              
27             1;
28              
29             __END__