line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Eixo::Queue::Job; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
79032
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
141
|
|
4
|
4
|
|
|
4
|
|
1255
|
use Eixo::Base::Clase; |
|
4
|
|
|
|
|
28178
|
|
|
4
|
|
|
|
|
26
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
2999
|
use JSON; |
|
4
|
|
|
|
|
37608
|
|
|
4
|
|
|
|
|
33
|
|
7
|
4
|
|
|
4
|
|
3403
|
use Data::UUID; |
|
4
|
|
|
|
|
3101
|
|
|
4
|
|
|
|
|
359
|
|
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
2075
|
use Eixo::Queue::JobCifrador; |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
79
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $UUID_INSTANCE; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
BEGIN{ |
14
|
4
|
|
|
4
|
|
4534
|
$UUID_INSTANCE = Data::UUID->new; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
4
|
0
|
45
|
sub WAITING { 'WAITING' } |
18
|
0
|
|
|
0
|
0
|
0
|
sub PROCESSING { 'PROCESSING' } |
19
|
0
|
|
|
0
|
0
|
0
|
sub FINISHED { 'FINISHED' } |
20
|
0
|
|
|
0
|
0
|
0
|
sub ERROR { 'ERROR' } |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub ID{ |
24
|
|
|
|
|
|
|
|
25
|
4
|
|
|
4
|
0
|
402
|
$UUID_INSTANCE->create_str; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my %NO_SERIALIZE = ( |
29
|
|
|
|
|
|
|
#id => 1 |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has( |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
id=> undef, |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
queue=>undef, |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
status=>WAITING, |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
creation_timestamp=>time, |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
start_timestamp => undef, |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
termination_timestamp => undef, |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
args=>undef, |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
results=>undef, |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub initialize { |
55
|
4
|
|
|
4
|
0
|
1003898
|
my ($self,@args) = @_; |
56
|
|
|
|
|
|
|
|
57
|
4
|
|
|
|
|
53
|
$self->{id} = &ID; |
58
|
4
|
|
|
|
|
12
|
$self->{args} = {}; |
59
|
4
|
|
|
|
|
7
|
$self->{results} = {}; |
60
|
|
|
|
|
|
|
|
61
|
4
|
|
|
|
|
39
|
$self->SUPER::initialize(@args); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub to_hash { |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
return { |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
map { |
70
|
8008
|
|
|
|
|
27118
|
$_ => $_[0]->{$_} |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
grep{ |
73
|
8008
|
|
|
|
|
10733
|
!$NO_SERIALIZE{$_} |
74
|
|
|
|
|
|
|
} |
75
|
1001
|
|
|
1001
|
0
|
970
|
keys(%{ $_[0] }) |
|
1001
|
|
|
|
|
3258
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub TO_JSON { |
81
|
1000
|
|
|
1000
|
0
|
1915
|
$_[0]->to_hash |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub copy{ |
85
|
0
|
|
|
0
|
0
|
0
|
my ($self, $j) = @_; |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
0
|
$self->{$_} = $j->{$_} foreach(keys(%$j)); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub processing{ |
91
|
|
|
|
|
|
|
|
92
|
0
|
0
|
|
0
|
0
|
0
|
$_[0]->start_timestamp(time) && $_[0]->status(PROCESSING) |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub finished{ |
96
|
|
|
|
|
|
|
|
97
|
0
|
0
|
|
0
|
0
|
0
|
$_[0]->termination_timestamp(time) && $_[0]->status(FINISHED) |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub serialize{ |
103
|
1000
|
|
|
1000
|
0
|
3740
|
my ($self) = @_; |
104
|
|
|
|
|
|
|
|
105
|
1000
|
|
|
|
|
7381
|
JSON->new->convert_blessed->encode( $self ) |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub unserialize{ |
109
|
1000
|
|
|
1000
|
0
|
1490
|
my ($package, $data) = @_; |
110
|
|
|
|
|
|
|
|
111
|
1000
|
50
|
|
|
|
1910
|
if(ref($package)){ |
112
|
0
|
|
|
|
|
0
|
$package = ref($package); |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
1000
|
|
|
|
|
19832
|
bless(JSON->new->decode($data), $package); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub setArg{ |
119
|
0
|
|
|
0
|
0
|
|
my ($self, $key, $value) = @_; |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
|
|
|
$self->args->{$key} = $value; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub setResult{ |
125
|
0
|
|
|
0
|
0
|
|
my ($self, $key, $value) = @_; |
126
|
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
|
$self->results->{$key} = $value; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub removeResult{ |
131
|
0
|
|
|
0
|
0
|
|
my ($self, $key) = @_; |
132
|
|
|
|
|
|
|
|
133
|
0
|
|
|
|
|
|
delete($self->results->{$key}); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
sub cifrar :Sig(self, s){ |
136
|
1
|
|
|
0
|
0
|
108
|
Eixo::Queue::JobCifrador->new->cifrar(@_); |
137
|
4
|
|
|
4
|
|
60
|
} |
|
4
|
|
|
|
|
22
|
|
|
4
|
|
|
|
|
42
|
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub descifrar :Sig(self, s, s){ |
140
|
1
|
|
|
0
|
0
|
53
|
Eixo::Queue::JobCifrador->new->descifrar(@_); |
141
|
4
|
|
|
4
|
|
1551
|
} |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
17
|
|
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
1; |