line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Helios::MetajobBurstService;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
839
|
use 5.008000;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
4
|
use base qw( Helios::Service );
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
119
|
|
5
|
|
|
|
|
|
|
use strict;
|
6
|
|
|
|
|
|
|
use warnings;
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '2.00';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Helios::MetajobBurstService - base class for metajob burst services in Helios
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Helios::MetajobBurstService is a subclass of Helios::Service specially tasked with bursting
|
17
|
|
|
|
|
|
|
metajobs. You can subclass this class to provide special metajob bursters for your application.
|
18
|
|
|
|
|
|
|
This allows you more fine grained control over the volume of jobs entering the Helios job queue.
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
A MetajobBurstService class supports one config parameter, burst_interval, which is the
|
21
|
|
|
|
|
|
|
number of seconds between metajob bursts. This is to prevent the metajob bursting process from
|
22
|
|
|
|
|
|
|
running so fast the Helios job queue is overwhelmed with burst jobs.
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub burstJob {
|
31
|
|
|
|
|
|
|
my $self = shift;
|
32
|
|
|
|
|
|
|
my $config = $self->getConfig();
|
33
|
|
|
|
|
|
|
my $jobnumber = $self->SUPER::burstJob(@_);
|
34
|
|
|
|
|
|
|
if ( defined($config->{burst_interval}) ) {
|
35
|
|
|
|
|
|
|
sleep $config->{burst_interval};
|
36
|
|
|
|
|
|
|
}
|
37
|
|
|
|
|
|
|
return $jobnumber;
|
38
|
|
|
|
|
|
|
}
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1;
|
42
|
|
|
|
|
|
|
__END__
|