line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Flux::Mapper::MappedOut; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Flux::Mapper::MappedOut::VERSION = '1.03'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: representation of mapper|out |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
23
|
use Moo; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
25
|
|
10
|
|
|
|
|
|
|
with 'Flux::Out'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'mapper' => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
required => 1, |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has 'out' => ( |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
required => 1, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub write { |
23
|
2
|
|
|
2
|
0
|
2462
|
my $self = shift; |
24
|
2
|
|
|
|
|
5
|
my ($item) = @_; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
14
|
my @items = $self->mapper->write($item); |
27
|
2
|
|
|
|
|
20
|
$self->out->write($_) for @items; |
28
|
2
|
|
|
|
|
6
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub write_chunk { |
32
|
0
|
|
|
0
|
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
|
|
|
|
|
|
|
sub commit { |
41
|
0
|
|
|
0
|
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
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |