line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MogileFS::ReplicationPolicy::Union; |
2
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
3
|
1
|
|
|
1
|
|
6
|
use base 'MogileFS::ReplicationPolicy'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
120
|
|
4
|
1
|
|
|
1
|
|
6
|
use MogileFS::ReplicationRequest qw(ALL_GOOD TOO_GOOD TEMP_NO_ANSWER); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
361
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new_from_policy_args { |
7
|
7
|
|
|
7
|
0
|
13
|
my ($class, $argref) = @_; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# first, eat off the open paren |
10
|
7
|
|
|
|
|
35
|
$$argref =~ s/^\s*\(\s*//; |
11
|
|
|
|
|
|
|
|
12
|
7
|
|
|
|
|
12
|
my @policies; |
13
|
|
|
|
|
|
|
POLICY: |
14
|
7
|
|
|
|
|
12
|
while (1) { |
15
|
14
|
|
|
|
|
46
|
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
|
|
|
|
|
41
|
$$argref =~ s/^\s*\,\s*//; |
19
|
14
|
100
|
|
|
|
66
|
last if $$argref =~ s/^\s*\)\s*//; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
7
|
|
|
|
|
45
|
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__ |