| 1 | package YARN::YarnClient; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | ## Create a new instance of YarnClient | ||
| 7 | 0 | ▶ | sub createYarnClient { |
|
Subroutine
createYarnClient: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 8 | 0 | my ($self, $conf) = @_; | |
| 9 | |||
| 10 | 0 | return $self; | |
| 11 | } | ||
| 12 | |||
| 13 | ## This method is a proxy for REST::Client | ||
| 14 | 0 | ▶ | sub connect { |
|
Subroutine
connect: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 15 | 0 | my $self = shift; | |
| 16 | |||
| 17 | 0 | $self = REST::Client->new(); | |
| 18 | |||
| 19 | 0 | return $self; | |
| 20 | } | ||
| 21 | |||
| 22 | ## Returns the URL of the API (example: yarn.example.com:8088/ws/v1/cluster/info) | ||
| 23 | 0 | ▶ | sub api_path { |
|
Subroutine
api_path: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 24 | 0 | my ($self, $conf, $api) = @_; | |
| 25 | |||
| 26 | 0 | my $url = $conf->{host} . ":" . $conf->{port} . $conf->{endpoint} . "/" . $api; | |
| 27 | |||
| 28 | 0 | return $url; | |
| 29 | } | ||
| 30 | |||
| 31 | 1 | 1; | |