line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Hadoop::YARN::NodeManager; |
2
|
|
|
|
|
|
|
$Net::Hadoop::YARN::NodeManager::VERSION = '0.202'; |
3
|
1
|
|
|
1
|
|
48442
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
80
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
5
|
1
|
|
|
1
|
|
16
|
use 5.10.0; |
|
1
|
|
|
|
|
3
|
|
6
|
1
|
|
|
1
|
|
889
|
use Moo; |
|
1
|
|
|
|
|
22074
|
|
|
1
|
|
|
|
|
8
|
|
7
|
1
|
|
|
1
|
|
2033
|
use Data::Dumper; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
523
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Net::Hadoop::YARN::Roles::Common'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has '+servers' => ( default => sub { ["localhost:50060"] }, ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub info { |
15
|
0
|
|
|
0
|
|
|
my $self = shift; |
16
|
0
|
|
|
|
|
|
my $res = $self->_get("node/info"); |
17
|
0
|
|
0
|
|
|
|
return $res->{nodeInfo} || $res; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub app { |
22
|
0
|
|
|
0
|
|
|
my $self = shift; |
23
|
0
|
|
|
|
|
|
return $self->apps(@_); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub apps { |
27
|
0
|
|
|
0
|
|
|
my $self = shift; |
28
|
0
|
|
|
|
|
|
my $app_id; |
29
|
|
|
|
|
|
|
my $options; |
30
|
0
|
0
|
|
|
|
|
if ( @_ == 1 ) { |
|
|
0
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
if ( !ref $_[0] ) { |
32
|
0
|
|
|
|
|
|
$app_id = shift; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
else { |
35
|
0
|
|
|
|
|
|
$options = shift; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
elsif ( @_ > 1 ) { |
39
|
0
|
|
|
|
|
|
$options = {@_}; |
40
|
|
|
|
|
|
|
} |
41
|
0
|
0
|
|
|
|
|
my $res = $self->_get( |
42
|
|
|
|
|
|
|
$app_id ? "node/apps/$app_id" : ( "node/apps", { params => $options } ) |
43
|
|
|
|
|
|
|
); |
44
|
0
|
|
0
|
|
|
|
return $res->{app} || $res; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub container { |
49
|
0
|
|
|
0
|
|
|
my $self = shift; |
50
|
0
|
|
|
|
|
|
return $self->containers(@_); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub containers { |
54
|
0
|
|
|
0
|
|
|
my $self = shift; |
55
|
0
|
|
|
|
|
|
my $container_id = shift; |
56
|
0
|
0
|
|
|
|
|
my $res = $self->_get( "node/containers" . ($container_id ? "/$container_id" : "") ); |
57
|
0
|
|
0
|
|
|
|
return $res->{container} || $res; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |