line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
=head1 NAME |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
C<MediaCloud::JobManager::Admin> - administration utilities. |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=cut |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package MediaCloud::JobManager::Admin; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
15188
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
11
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
12
|
1
|
|
|
1
|
|
5
|
use Modern::Perl "2012"; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
10
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
159
|
use MediaCloud::JobManager; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
15
|
1
|
|
|
1
|
|
5
|
use MediaCloud::JobManager::Configuration; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
274
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub show_jobs($) |
18
|
|
|
|
|
|
|
{ |
19
|
0
|
|
|
0
|
0
|
|
my $config = shift; |
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
unless ( $config ) |
22
|
|
|
|
|
|
|
{ |
23
|
0
|
|
|
|
|
|
die "Configuration is undefined."; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return $config->{ broker }->show_jobs(); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub cancel_job($$) |
30
|
|
|
|
|
|
|
{ |
31
|
0
|
|
|
0
|
0
|
|
my ( $config, $job_id ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
unless ( $config ) |
34
|
|
|
|
|
|
|
{ |
35
|
0
|
|
|
|
|
|
die "Configuration is undefined."; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return $config->{ broker }->cancel_job( $job_id ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub server_status($) |
42
|
|
|
|
|
|
|
{ |
43
|
0
|
|
|
0
|
0
|
|
my $config = shift; |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
|
unless ( $config ) |
46
|
|
|
|
|
|
|
{ |
47
|
0
|
|
|
|
|
|
die "Configuration is undefined."; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $config->{ broker }->server_status(); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub workers($) |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
0
|
0
|
|
my $config = shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
unless ( $config ) |
58
|
|
|
|
|
|
|
{ |
59
|
0
|
|
|
|
|
|
die "Configuration is undefined."; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
return $config->{ broker }->workers(); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|