line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MogileFS::ReplicationPolicy::Union; |
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
3
|
1
|
|
|
1
|
|
5
|
use base 'MogileFS::ReplicationPolicy'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
77
|
|
4
|
1
|
|
|
1
|
|
6
|
use MogileFS::ReplicationRequest qw(ALL_GOOD TOO_GOOD TEMP_NO_ANSWER); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
216
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new_from_policy_args { |
7
|
7
|
|
|
7
|
0
|
14
|
my ($class, $argref) = @_; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# first, eat off the open paren |
10
|
7
|
|
|
|
|
36
|
$$argref =~ s/^\s*\(\s*//; |
11
|
|
|
|
|
|
|
|
12
|
7
|
|
|
|
|
13
|
my @policies; |
13
|
|
|
|
|
|
|
POLICY: |
14
|
7
|
|
|
|
|
10
|
while (1) { |
15
|
14
|
|
|
|
|
34
|
my $pol = MogileFS::ReplicationPolicy->new_from_policy_string($argref); |
16
|
14
|
|
|
|
|
26
|
push @policies, $pol; |
17
|
|
|
|
|
|
|
# eat a comma if it's there. |
18
|
14
|
|
|
|
|
35
|
$$argref =~ s/^\s*\,\s*//; |
19
|
14
|
100
|
|
|
|
48
|
last if $$argref =~ s/^\s*\)\s*//; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
7
|
|
|
|
|
55
|
return bless { |
23
|
|
|
|
|
|
|
policies => \@policies, |
24
|
|
|
|
|
|
|
}, $class; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub replicate_to { |
29
|
0
|
|
|
0
|
0
|
|
my ($self, %args) = @_; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# TODO: walk $self->{ |
32
|
0
|
|
|
|
|
|
die "not implemented"; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |