line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MogileFS::ReplicationPolicy::Union; |
2
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
3
|
1
|
|
|
1
|
|
4
|
use base 'MogileFS::ReplicationPolicy'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
83
|
|
4
|
1
|
|
|
1
|
|
5
|
use MogileFS::ReplicationRequest qw(ALL_GOOD TOO_GOOD TEMP_NO_ANSWER); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
236
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new_from_policy_args { |
7
|
7
|
|
|
7
|
0
|
10
|
my ($class, $argref) = @_; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# first, eat off the open paren |
10
|
7
|
|
|
|
|
45
|
$$argref =~ s/^\s*\(\s*//; |
11
|
|
|
|
|
|
|
|
12
|
7
|
|
|
|
|
8
|
my @policies; |
13
|
|
|
|
|
|
|
POLICY: |
14
|
7
|
|
|
|
|
6
|
while (1) { |
15
|
14
|
|
|
|
|
34
|
my $pol = MogileFS::ReplicationPolicy->new_from_policy_string($argref); |
16
|
14
|
|
|
|
|
18
|
push @policies, $pol; |
17
|
|
|
|
|
|
|
# eat a comma if it's there. |
18
|
14
|
|
|
|
|
57
|
$$argref =~ s/^\s*\,\s*//; |
19
|
14
|
100
|
|
|
|
45
|
last if $$argref =~ s/^\s*\)\s*//; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
7
|
|
|
|
|
28
|
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__ |