File Coverage

blib/lib/Net/Hadoop/YARN/HistoryServer.pm
Criterion Covered Total %
statement 11 20 55.0
branch n/a
condition n/a
subroutine 4 8 50.0
pod 4 4 100.0
total 19 32 59.3


line stmt bran cond sub pod time code
1             package Net::Hadoop::YARN::HistoryServer;
2             $Net::Hadoop::YARN::HistoryServer::VERSION = '0.203';
3 2     2   84446 use strict;
  2         12  
  2         46  
4 2     2   9 use warnings;
  2         2  
  2         38  
5 2     2   23 use 5.10.0;
  2         8  
6 2     2   435 use Moo;
  2         8995  
  2         9  
7              
8             with 'Net::Hadoop::YARN::Roles::AppMasterHistoryServer';
9             with 'Net::Hadoop::YARN::Roles::Common';
10              
11             #<<<
12             my $methods_urls = {
13             _get_jobs => ['/ws/v1/history/mapreduce/jobs', 'job' ],
14             job => ['/ws/v1/history/mapreduce/jobs/{jobid}', '' ],
15             jobconf => ['/ws/v1/history/mapreduce/jobs/{jobid}/conf', '' ],
16             jobcounters => ['/ws/v1/history/mapreduce/jobs/{jobid}/counters', 'counterGroup' ],
17             jobattempts => ['/ws/v1/history/mapreduce/jobs/{jobid}/jobattempts', 'jobAttempt' ],
18             _get_tasks => ['/ws/v1/history/mapreduce/jobs/{jobid}/tasks', 'task' ],
19             task => ['/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}', '' ],
20             taskcounters => ['/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/counters', 'taskCounterGroup' ],
21             taskattempts => ['/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts', 'taskAttempt' ],
22             _get_taskattempt => ['/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}', '' ],
23             taskattemptcounters => ['/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}/counters', 'taskAttemptCounterGroup' ],
24             };
25             #>>>
26              
27             # For each of the keys:
28             # - make a method, adding the path
29             # - pass the path and variables to a validation and substitution engine
30             # - execute the request
31             # - return the proper fragment of the JSON tree
32              
33             _mk_subs($methods_urls);
34              
35             has '+servers' => (
36             default => sub { ["localhost:19888"] }, # same as resource manager by default
37             );
38              
39             sub info {
40 0     0 1   my $self = shift;
41 0           my $res = $self->_get("info");
42 0           return $res->{info};
43             }
44              
45             sub jobs {
46 0     0 1   my $self = shift;
47 0           $self->_get_jobs(@_);
48             }
49              
50             sub tasks {
51 0     0 1   my $self = shift;
52 0           $self->_get_tasks(@_);
53             }
54              
55             sub taskattempt {
56 0     0 1   my $self = shift;
57 0           my $attempt = $self->_get_taskattempt(@_);
58             }
59              
60             1;
61              
62             __END__