line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package NetApp::Aggregate::Plex; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '500.002'; |
5
|
|
|
|
|
|
|
$VERSION = eval $VERSION; ## no critic: StringyEval |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
9
|
1
|
|
|
1
|
|
5
|
use English; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
10
|
1
|
|
|
1
|
|
806
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
5
|
use Class::Std; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
13
|
1
|
|
|
1
|
|
119
|
use Params::Validate qw( :all ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
202
|
|
14
|
1
|
|
|
1
|
|
6
|
use Regexp::Common; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
{ |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my %name_of :ATTR( get => 'name' ); |
19
|
|
|
|
|
|
|
my %state_of :ATTR; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my %raidgroups_of :ATTR; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub BUILD { |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
0
|
0
|
|
my ($self,$ident,$args_ref) = @_; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my @args = %$args_ref; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my (%args) = validate( @args, { |
30
|
|
|
|
|
|
|
name => { type => SCALAR }, |
31
|
|
|
|
|
|
|
state => { type => HASHREF }, |
32
|
|
|
|
|
|
|
raidgroups => { type => ARRAYREF }, |
33
|
|
|
|
|
|
|
}); |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
$name_of{$ident} = $args{name}; |
36
|
0
|
|
|
|
|
|
$state_of{$ident} = $args{state}; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
$raidgroups_of{$ident} = []; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
foreach my $raidgroup ( @{ $args{raidgroups} } ) { |
|
0
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
push @{ $raidgroups_of{$ident} }, |
|
0
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
NetApp::Aggregate::RAIDGroup->new( $raidgroup ); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub get_raidgroups { |
48
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
49
|
0
|
|
|
|
|
|
my $ident = ident $self; |
50
|
0
|
|
|
|
|
|
return @{ $raidgroups_of{$ident} }; |
|
0
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub get_states { |
54
|
0
|
|
|
0
|
1
|
|
return keys %{ $state_of{ident shift} }; |
|
0
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub get_state { |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
60
|
0
|
|
|
|
|
|
my $ident = ident $self; |
61
|
0
|
|
|
|
|
|
my $state = shift; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return $state_of{$ident}->{$state}; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |