line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::RuledCluster::Strategy; |
2
|
6
|
|
|
6
|
|
18366
|
use strict; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
144
|
|
3
|
6
|
|
|
6
|
|
24
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
115
|
|
4
|
6
|
|
|
6
|
|
24
|
use Carp; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
322
|
|
5
|
6
|
|
|
6
|
|
30
|
use Data::Util qw(is_array_ref); |
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
1457
|
|
6
|
|
|
|
|
|
|
|
7
|
0
|
|
|
0
|
0
|
0
|
sub resolve { Carp::croak('Not implement') } |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub resolve_node_keys { |
10
|
23
|
|
|
23
|
0
|
57
|
my ($class, $resolver, $cluster_or_node, $args, $options) = @_; |
11
|
|
|
|
|
|
|
|
12
|
23
|
|
|
|
|
36
|
my %node_keys; |
13
|
23
|
|
|
|
|
47
|
for my $key ($class->keys_from_args($args)) { |
14
|
49
|
|
|
|
|
142
|
my %args = %$args; |
15
|
49
|
|
|
|
|
93
|
$args{key} = $key; |
16
|
|
|
|
|
|
|
|
17
|
49
|
|
|
|
|
131
|
my ($resolved, @keys) = $class->resolve($resolver, $cluster_or_node, \%args, $options); |
18
|
|
|
|
|
|
|
|
19
|
49
|
|
100
|
|
|
388
|
my $node_keys = $node_keys{ $resolved } ||= []; |
20
|
49
|
100
|
|
|
|
117
|
if ($resolver->is_cluster($resolved)) { |
21
|
16
|
|
|
|
|
83
|
push @$node_keys, { |
22
|
|
|
|
|
|
|
root => $key, |
23
|
|
|
|
|
|
|
next => \@keys, |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
else { |
27
|
33
|
|
|
|
|
138
|
push @$node_keys, $key; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
23
|
|
|
|
|
117
|
return %node_keys; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub keys_from_args { |
35
|
108
|
|
|
108
|
0
|
185
|
my ( $class, $args ) = @_; |
36
|
108
|
100
|
|
|
|
353
|
return is_array_ref( $args->{key} ) ? @{ $args->{key} } : ( $args->{key} ); |
|
30
|
|
|
|
|
95
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|