lib/Flux/Mapper/MappedOut.pm

filter: Statementstmt 58.3% 14 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 3 totaltotal 51.6% 16 / 31 CC 2 SCAR 5.9
CC
2
Cov
58%
write
2.0
write_chunk
2.0
commit
2.0
CRAP 1.8
« blib/lib/Flux/Role/Owned.pm ↑ Summary lib/Flux/Mapper/MappedMapper.pm »
1 package Flux::Mapper::MappedOut;
2 {
3 4 $Flux::Mapper::MappedOut::VERSION = '1.03';
4 }
5  
6 # ABSTRACT: representation of mapper|out
7  
8  
9 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 with 'Flux::Out';
11  
12 4 has 'mapper' => (
13 is => 'ro',
14 required => 1,
15 );
16  
17 4 has 'out' => (
18 is => 'ro',
19 required => 1,
20 );
21  
22 2 ▶sub write {
Subroutine write: called CC=2 SCAR=6.9
Pod undocumented
23 2 my $self = shift;
24 2 my ($item) = @_;
25  
26 2 my @items = $self->mapper->write($item);
27 2 $self->out->write($_) for @items;
28 2 return;
29 }
30  
31 0 ▶sub write_chunk {
Subroutine write_chunk: not called CC=1 SCAR=6.9
Pod undocumented
32 0 my $self = shift;
33 0 my ($chunk) = @_;
34  
35 0 $chunk = $self->mapper->write_chunk($chunk);
36 0 $self->out->write_chunk($chunk);
37 0 return;
38 }
39  
40 0 ▶sub commit {
Subroutine commit: not called CC=1 SCAR=6.9
Pod undocumented
41 0 my ($self) = @_;
42  
43 0 my @items = $self->mapper->commit; # flushing the stuff remaining in possible mapper buffers
44 0 $self->out->write_chunk(\@items);
45 0 $self->out->commit;
46 0 return;
47 }
48  
49 4 1;
50  
51 __END__
« blib/lib/Flux/Role/Owned.pm ↑ Summary lib/Flux/Mapper/MappedMapper.pm »