line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Autogenerated by Thrift Compiler (0.16.0) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
5
|
|
|
|
|
|
|
# |
6
|
1
|
|
|
1
|
|
440
|
use 5.10.0; |
|
1
|
|
|
|
|
3
|
|
7
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
8
|
1
|
|
|
1
|
|
11
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
9
|
1
|
|
|
1
|
|
5
|
use Thrift::Exception; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
10
|
1
|
|
|
1
|
|
5
|
use Thrift::MessageType; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
13
|
|
11
|
1
|
|
|
1
|
|
3
|
use Thrift::Type; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use Types; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# HELPER FUNCTIONS AND STRUCTURES |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package Aggr_addValue_args; |
19
|
1
|
|
|
1
|
|
5
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
433
|
|
20
|
|
|
|
|
|
|
Aggr_addValue_args->mk_accessors( qw( value ) ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
10
|
|
|
10
|
|
11
|
my $classname = shift; |
24
|
10
|
|
|
|
|
12
|
my $self = {}; |
25
|
10
|
|
50
|
|
|
26
|
my $vals = shift || {}; |
26
|
10
|
|
|
|
|
13
|
$self->{value} = undef; |
27
|
10
|
50
|
|
|
|
21
|
if (UNIVERSAL::isa($vals,'HASH')) { |
28
|
10
|
50
|
|
|
|
29
|
if (defined $vals->{value}) { |
29
|
0
|
|
|
|
|
0
|
$self->{value} = $vals->{value}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
10
|
|
|
|
|
17
|
return bless ($self, $classname); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub getName { |
36
|
0
|
|
|
0
|
|
0
|
return 'Aggr_addValue_args'; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub read { |
40
|
5
|
|
|
5
|
|
6
|
my ($self, $input) = @_; |
41
|
5
|
|
|
|
|
5
|
my $xfer = 0; |
42
|
5
|
|
|
|
|
5
|
my $fname; |
43
|
5
|
|
|
|
|
3
|
my $ftype = 0; |
44
|
5
|
|
|
|
|
4
|
my $fid = 0; |
45
|
5
|
|
|
|
|
13
|
$xfer += $input->readStructBegin(\$fname); |
46
|
5
|
|
|
|
|
5
|
while (1) |
47
|
|
|
|
|
|
|
{ |
48
|
10
|
|
|
|
|
15
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
49
|
10
|
100
|
|
|
|
14
|
if ($ftype == Thrift::TType::STOP) { |
50
|
5
|
|
|
|
|
5
|
last; |
51
|
|
|
|
|
|
|
} |
52
|
5
|
|
|
|
|
9
|
SWITCH: for($fid) |
53
|
|
|
|
|
|
|
{ |
54
|
5
|
50
|
|
|
|
27
|
/^1$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
5
|
50
|
|
|
|
14
|
|
55
|
5
|
|
|
|
|
13
|
$xfer += $input->readI32(\$self->{value}); |
56
|
|
|
|
|
|
|
} else { |
57
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
58
|
|
|
|
|
|
|
} |
59
|
5
|
|
|
|
|
6
|
last; }; |
60
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
61
|
|
|
|
|
|
|
} |
62
|
5
|
|
|
|
|
9
|
$xfer += $input->readFieldEnd(); |
63
|
|
|
|
|
|
|
} |
64
|
5
|
|
|
|
|
11
|
$xfer += $input->readStructEnd(); |
65
|
5
|
|
|
|
|
6
|
return $xfer; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub write { |
69
|
5
|
|
|
5
|
|
7
|
my ($self, $output) = @_; |
70
|
5
|
|
|
|
|
5
|
my $xfer = 0; |
71
|
5
|
|
|
|
|
11
|
$xfer += $output->writeStructBegin('Aggr_addValue_args'); |
72
|
5
|
50
|
|
|
|
9
|
if (defined $self->{value}) { |
73
|
5
|
|
|
|
|
10
|
$xfer += $output->writeFieldBegin('value', Thrift::TType::I32, 1); |
74
|
5
|
|
|
|
|
11
|
$xfer += $output->writeI32($self->{value}); |
75
|
5
|
|
|
|
|
11
|
$xfer += $output->writeFieldEnd(); |
76
|
|
|
|
|
|
|
} |
77
|
5
|
|
|
|
|
8
|
$xfer += $output->writeFieldStop(); |
78
|
5
|
|
|
|
|
20
|
$xfer += $output->writeStructEnd(); |
79
|
5
|
|
|
|
|
5
|
return $xfer; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
package Aggr_addValue_result; |
83
|
1
|
|
|
1
|
|
7
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
288
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub new { |
86
|
10
|
|
|
10
|
|
22
|
my $classname = shift; |
87
|
10
|
|
|
|
|
11
|
my $self = {}; |
88
|
10
|
|
50
|
|
|
24
|
my $vals = shift || {}; |
89
|
10
|
|
|
|
|
20
|
return bless ($self, $classname); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub getName { |
93
|
0
|
|
|
0
|
|
0
|
return 'Aggr_addValue_result'; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub read { |
97
|
5
|
|
|
5
|
|
14
|
my ($self, $input) = @_; |
98
|
5
|
|
|
|
|
5
|
my $xfer = 0; |
99
|
5
|
|
|
|
|
3
|
my $fname; |
100
|
5
|
|
|
|
|
5
|
my $ftype = 0; |
101
|
5
|
|
|
|
|
5
|
my $fid = 0; |
102
|
5
|
|
|
|
|
19
|
$xfer += $input->readStructBegin(\$fname); |
103
|
5
|
|
|
|
|
4
|
while (1) |
104
|
|
|
|
|
|
|
{ |
105
|
5
|
|
|
|
|
13
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
106
|
5
|
50
|
|
|
|
8
|
if ($ftype == Thrift::TType::STOP) { |
107
|
5
|
|
|
|
|
5
|
last; |
108
|
|
|
|
|
|
|
} |
109
|
0
|
|
|
|
|
0
|
SWITCH: for($fid) |
110
|
|
|
|
|
|
|
{ |
111
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
112
|
|
|
|
|
|
|
} |
113
|
0
|
|
|
|
|
0
|
$xfer += $input->readFieldEnd(); |
114
|
|
|
|
|
|
|
} |
115
|
5
|
|
|
|
|
9
|
$xfer += $input->readStructEnd(); |
116
|
5
|
|
|
|
|
7
|
return $xfer; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub write { |
120
|
5
|
|
|
5
|
|
7
|
my ($self, $output) = @_; |
121
|
5
|
|
|
|
|
5
|
my $xfer = 0; |
122
|
5
|
|
|
|
|
8
|
$xfer += $output->writeStructBegin('Aggr_addValue_result'); |
123
|
5
|
|
|
|
|
7
|
$xfer += $output->writeFieldStop(); |
124
|
5
|
|
|
|
|
10
|
$xfer += $output->writeStructEnd(); |
125
|
5
|
|
|
|
|
6
|
return $xfer; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
package Aggr_getValues_args; |
129
|
1
|
|
|
1
|
|
6
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
294
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub new { |
132
|
2
|
|
|
2
|
|
3
|
my $classname = shift; |
133
|
2
|
|
|
|
|
3
|
my $self = {}; |
134
|
2
|
|
50
|
|
|
6
|
my $vals = shift || {}; |
135
|
2
|
|
|
|
|
4
|
return bless ($self, $classname); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub getName { |
139
|
0
|
|
|
0
|
|
0
|
return 'Aggr_getValues_args'; |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub read { |
143
|
1
|
|
|
1
|
|
3
|
my ($self, $input) = @_; |
144
|
1
|
|
|
|
|
1
|
my $xfer = 0; |
145
|
1
|
|
|
|
|
1
|
my $fname; |
146
|
1
|
|
|
|
|
1
|
my $ftype = 0; |
147
|
1
|
|
|
|
|
2
|
my $fid = 0; |
148
|
1
|
|
|
|
|
3
|
$xfer += $input->readStructBegin(\$fname); |
149
|
1
|
|
|
|
|
2
|
while (1) |
150
|
|
|
|
|
|
|
{ |
151
|
1
|
|
|
|
|
2
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
152
|
1
|
50
|
|
|
|
3
|
if ($ftype == Thrift::TType::STOP) { |
153
|
1
|
|
|
|
|
2
|
last; |
154
|
|
|
|
|
|
|
} |
155
|
0
|
|
|
|
|
0
|
SWITCH: for($fid) |
156
|
|
|
|
|
|
|
{ |
157
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
158
|
|
|
|
|
|
|
} |
159
|
0
|
|
|
|
|
0
|
$xfer += $input->readFieldEnd(); |
160
|
|
|
|
|
|
|
} |
161
|
1
|
|
|
|
|
3
|
$xfer += $input->readStructEnd(); |
162
|
1
|
|
|
|
|
1
|
return $xfer; |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub write { |
166
|
1
|
|
|
1
|
|
10
|
my ($self, $output) = @_; |
167
|
1
|
|
|
|
|
3
|
my $xfer = 0; |
168
|
1
|
|
|
|
|
3
|
$xfer += $output->writeStructBegin('Aggr_getValues_args'); |
169
|
1
|
|
|
|
|
3
|
$xfer += $output->writeFieldStop(); |
170
|
1
|
|
|
|
|
3
|
$xfer += $output->writeStructEnd(); |
171
|
1
|
|
|
|
|
1
|
return $xfer; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
package Aggr_getValues_result; |
175
|
1
|
|
|
1
|
|
5
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
605
|
|
176
|
|
|
|
|
|
|
Aggr_getValues_result->mk_accessors( qw( success ) ); |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
sub new { |
179
|
2
|
|
|
2
|
|
6
|
my $classname = shift; |
180
|
2
|
|
|
|
|
2
|
my $self = {}; |
181
|
2
|
|
50
|
|
|
7
|
my $vals = shift || {}; |
182
|
2
|
|
|
|
|
5
|
$self->{success} = undef; |
183
|
2
|
|
|
|
|
11
|
$self->{err} = undef; |
184
|
2
|
50
|
|
|
|
19
|
if (UNIVERSAL::isa($vals,'HASH')) { |
185
|
2
|
50
|
|
|
|
5
|
if (defined $vals->{success}) { |
186
|
0
|
|
|
|
|
0
|
$self->{success} = $vals->{success}; |
187
|
|
|
|
|
|
|
} |
188
|
2
|
50
|
|
|
|
5
|
if (defined $vals->{err}) { |
189
|
0
|
|
|
|
|
0
|
$self->{err} = $vals->{err}; |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
} |
192
|
2
|
|
|
|
|
4
|
return bless ($self, $classname); |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
sub getName { |
196
|
0
|
|
|
0
|
|
0
|
return 'Aggr_getValues_result'; |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
sub read { |
200
|
1
|
|
|
1
|
|
5
|
my ($self, $input) = @_; |
201
|
1
|
|
|
|
|
2
|
my $xfer = 0; |
202
|
1
|
|
|
|
|
1
|
my $fname; |
203
|
1
|
|
|
|
|
1
|
my $ftype = 0; |
204
|
1
|
|
|
|
|
2
|
my $fid = 0; |
205
|
1
|
|
|
|
|
2
|
$xfer += $input->readStructBegin(\$fname); |
206
|
1
|
|
|
|
|
1
|
while (1) |
207
|
|
|
|
|
|
|
{ |
208
|
2
|
|
|
|
|
4
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
209
|
2
|
100
|
|
|
|
5
|
if ($ftype == Thrift::TType::STOP) { |
210
|
1
|
|
|
|
|
1
|
last; |
211
|
|
|
|
|
|
|
} |
212
|
1
|
|
|
|
|
2
|
SWITCH: for($fid) |
213
|
|
|
|
|
|
|
{ |
214
|
1
|
50
|
|
|
|
4
|
/^0$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
1
|
50
|
|
|
|
4
|
|
215
|
|
|
|
|
|
|
{ |
216
|
1
|
|
|
|
|
1
|
my $_size0 = 0; |
|
1
|
|
|
|
|
2
|
|
217
|
1
|
|
|
|
|
1
|
$self->{success} = []; |
218
|
1
|
|
|
|
|
2
|
my $_etype3 = 0; |
219
|
1
|
|
|
|
|
15
|
$xfer += $input->readListBegin(\$_etype3, \$_size0); |
220
|
1
|
|
|
|
|
3
|
for (my $_i4 = 0; $_i4 < $_size0; ++$_i4) |
221
|
|
|
|
|
|
|
{ |
222
|
5
|
|
|
|
|
5
|
my $elem5 = undef; |
223
|
5
|
|
|
|
|
17
|
$xfer += $input->readI32(\$elem5); |
224
|
5
|
|
|
|
|
5
|
push(@{$self->{success}},$elem5); |
|
5
|
|
|
|
|
10
|
|
225
|
|
|
|
|
|
|
} |
226
|
1
|
|
|
|
|
5
|
$xfer += $input->readListEnd(); |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
} else { |
229
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
230
|
|
|
|
|
|
|
} |
231
|
1
|
|
|
|
|
2
|
last; }; |
232
|
0
|
0
|
|
|
|
0
|
/^1$/ && do{ if ($ftype == Thrift::TType::STRUCT) { |
|
0
|
0
|
|
|
|
0
|
|
233
|
0
|
|
|
|
|
0
|
$self->{err} = Error->new(); |
234
|
0
|
|
|
|
|
0
|
$xfer += $self->{err}->read($input); |
235
|
|
|
|
|
|
|
} else { |
236
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
237
|
|
|
|
|
|
|
} |
238
|
0
|
|
|
|
|
0
|
last; }; |
239
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
240
|
|
|
|
|
|
|
} |
241
|
1
|
|
|
|
|
5
|
$xfer += $input->readFieldEnd(); |
242
|
|
|
|
|
|
|
} |
243
|
1
|
|
|
|
|
3
|
$xfer += $input->readStructEnd(); |
244
|
1
|
|
|
|
|
10
|
return $xfer; |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
sub write { |
248
|
1
|
|
|
1
|
|
2
|
my ($self, $output) = @_; |
249
|
1
|
|
|
|
|
1
|
my $xfer = 0; |
250
|
1
|
|
|
|
|
2
|
$xfer += $output->writeStructBegin('Aggr_getValues_result'); |
251
|
1
|
50
|
|
|
|
3
|
if (defined $self->{success}) { |
252
|
1
|
|
|
|
|
3
|
$xfer += $output->writeFieldBegin('success', Thrift::TType::LIST, 0); |
253
|
|
|
|
|
|
|
{ |
254
|
1
|
|
|
|
|
2
|
$xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{$self->{success}})); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
255
|
|
|
|
|
|
|
{ |
256
|
1
|
|
|
|
|
2
|
foreach my $iter6 (@{$self->{success}}) |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
257
|
|
|
|
|
|
|
{ |
258
|
5
|
|
|
|
|
6
|
$xfer += $output->writeI32($iter6); |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
} |
261
|
1
|
|
|
|
|
3
|
$xfer += $output->writeListEnd(); |
262
|
|
|
|
|
|
|
} |
263
|
1
|
|
|
|
|
2
|
$xfer += $output->writeFieldEnd(); |
264
|
|
|
|
|
|
|
} |
265
|
1
|
50
|
|
|
|
3
|
if (defined $self->{err}) { |
266
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldBegin('err', Thrift::TType::STRUCT, 1); |
267
|
0
|
|
|
|
|
0
|
$xfer += $self->{err}->write($output); |
268
|
0
|
|
|
|
|
0
|
$xfer += $output->writeFieldEnd(); |
269
|
|
|
|
|
|
|
} |
270
|
1
|
|
|
|
|
2
|
$xfer += $output->writeFieldStop(); |
271
|
1
|
|
|
|
|
2
|
$xfer += $output->writeStructEnd(); |
272
|
1
|
|
|
|
|
1
|
return $xfer; |
273
|
|
|
|
|
|
|
} |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
package AggrIf; |
276
|
|
|
|
|
|
|
|
277
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
84
|
|
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
sub addValue{ |
281
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
282
|
0
|
|
|
|
|
0
|
my $value = shift; |
283
|
|
|
|
|
|
|
|
284
|
0
|
|
|
|
|
0
|
die 'implement interface'; |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
sub getValues{ |
288
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
289
|
|
|
|
|
|
|
|
290
|
0
|
|
|
|
|
0
|
die 'implement interface'; |
291
|
|
|
|
|
|
|
} |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
package AggrRest; |
294
|
|
|
|
|
|
|
|
295
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
136
|
|
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
sub new { |
299
|
0
|
|
|
0
|
|
0
|
my ($classname, $impl) = @_; |
300
|
0
|
|
|
|
|
0
|
my $self ={ impl => $impl }; |
301
|
|
|
|
|
|
|
|
302
|
0
|
|
|
|
|
0
|
return bless($self,$classname); |
303
|
|
|
|
|
|
|
} |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
sub addValue{ |
306
|
0
|
|
|
0
|
|
0
|
my ($self, $request) = @_; |
307
|
|
|
|
|
|
|
|
308
|
0
|
0
|
|
|
|
0
|
my $value = ($request->{'value'}) ? $request->{'value'} : undef; |
309
|
0
|
|
|
|
|
0
|
return $self->{impl}->addValue($value); |
310
|
|
|
|
|
|
|
} |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
sub getValues{ |
313
|
0
|
|
|
0
|
|
0
|
my ($self, $request) = @_; |
314
|
|
|
|
|
|
|
|
315
|
0
|
|
|
|
|
0
|
return $self->{impl}->getValues(); |
316
|
|
|
|
|
|
|
} |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
package AggrClient; |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
|
321
|
1
|
|
|
1
|
|
6
|
use base qw(AggrIf); |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
919
|
|
322
|
|
|
|
|
|
|
sub new { |
323
|
1
|
|
|
1
|
|
8
|
my ($classname, $input, $output) = @_; |
324
|
1
|
|
|
|
|
2
|
my $self = {}; |
325
|
1
|
|
|
|
|
2
|
$self->{input} = $input; |
326
|
1
|
50
|
|
|
|
4
|
$self->{output} = defined $output ? $output : $input; |
327
|
1
|
|
|
|
|
2
|
$self->{seqid} = 0; |
328
|
1
|
|
|
|
|
2
|
return bless($self,$classname); |
329
|
|
|
|
|
|
|
} |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
sub addValue{ |
332
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
333
|
0
|
|
|
|
|
0
|
my $value = shift; |
334
|
|
|
|
|
|
|
|
335
|
0
|
|
|
|
|
0
|
$self->send_addValue($value); |
336
|
0
|
|
|
|
|
0
|
$self->recv_addValue(); |
337
|
|
|
|
|
|
|
} |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
sub send_addValue{ |
340
|
5
|
|
|
5
|
|
22
|
my $self = shift; |
341
|
5
|
|
|
|
|
4
|
my $value = shift; |
342
|
|
|
|
|
|
|
|
343
|
5
|
|
|
|
|
14
|
$self->{output}->writeMessageBegin('addValue', Thrift::TMessageType::CALL, $self->{seqid}); |
344
|
5
|
|
|
|
|
8
|
my $args = Aggr_addValue_args->new(); |
345
|
5
|
|
|
|
|
9
|
$args->{value} = $value; |
346
|
5
|
|
|
|
|
10
|
$args->write($self->{output}); |
347
|
5
|
|
|
|
|
13
|
$self->{output}->writeMessageEnd(); |
348
|
5
|
|
|
|
|
9
|
$self->{output}->getTransport()->flush(); |
349
|
|
|
|
|
|
|
} |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
sub recv_addValue{ |
352
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
353
|
|
|
|
|
|
|
|
354
|
0
|
|
|
|
|
0
|
my $rseqid = 0; |
355
|
0
|
|
|
|
|
0
|
my $fname; |
356
|
0
|
|
|
|
|
0
|
my $mtype = 0; |
357
|
|
|
|
|
|
|
|
358
|
0
|
|
|
|
|
0
|
$self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid); |
359
|
0
|
0
|
|
|
|
0
|
if ($mtype == Thrift::TMessageType::EXCEPTION) { |
360
|
0
|
|
|
|
|
0
|
my $x = Thrift::TApplicationException->new(); |
361
|
0
|
|
|
|
|
0
|
$x->read($self->{input}); |
362
|
0
|
|
|
|
|
0
|
$self->{input}->readMessageEnd(); |
363
|
0
|
|
|
|
|
0
|
die $x; |
364
|
|
|
|
|
|
|
} |
365
|
0
|
|
|
|
|
0
|
my $result = Aggr_addValue_result->new(); |
366
|
0
|
|
|
|
|
0
|
$result->read($self->{input}); |
367
|
0
|
|
|
|
|
0
|
$self->{input}->readMessageEnd(); |
368
|
|
|
|
|
|
|
|
369
|
0
|
|
|
|
|
0
|
return; |
370
|
|
|
|
|
|
|
} |
371
|
|
|
|
|
|
|
sub getValues{ |
372
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
373
|
|
|
|
|
|
|
|
374
|
0
|
|
|
|
|
0
|
$self->send_getValues(); |
375
|
0
|
|
|
|
|
0
|
return $self->recv_getValues(); |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
sub send_getValues{ |
379
|
1
|
|
|
1
|
|
5
|
my $self = shift; |
380
|
|
|
|
|
|
|
|
381
|
1
|
|
|
|
|
3
|
$self->{output}->writeMessageBegin('getValues', Thrift::TMessageType::CALL, $self->{seqid}); |
382
|
1
|
|
|
|
|
5
|
my $args = Aggr_getValues_args->new(); |
383
|
1
|
|
|
|
|
4
|
$args->write($self->{output}); |
384
|
1
|
|
|
|
|
3
|
$self->{output}->writeMessageEnd(); |
385
|
1
|
|
|
|
|
3
|
$self->{output}->getTransport()->flush(); |
386
|
|
|
|
|
|
|
} |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
sub recv_getValues{ |
389
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
390
|
|
|
|
|
|
|
|
391
|
0
|
|
|
|
|
0
|
my $rseqid = 0; |
392
|
0
|
|
|
|
|
0
|
my $fname; |
393
|
0
|
|
|
|
|
0
|
my $mtype = 0; |
394
|
|
|
|
|
|
|
|
395
|
0
|
|
|
|
|
0
|
$self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid); |
396
|
0
|
0
|
|
|
|
0
|
if ($mtype == Thrift::TMessageType::EXCEPTION) { |
397
|
0
|
|
|
|
|
0
|
my $x = Thrift::TApplicationException->new(); |
398
|
0
|
|
|
|
|
0
|
$x->read($self->{input}); |
399
|
0
|
|
|
|
|
0
|
$self->{input}->readMessageEnd(); |
400
|
0
|
|
|
|
|
0
|
die $x; |
401
|
|
|
|
|
|
|
} |
402
|
0
|
|
|
|
|
0
|
my $result = Aggr_getValues_result->new(); |
403
|
0
|
|
|
|
|
0
|
$result->read($self->{input}); |
404
|
0
|
|
|
|
|
0
|
$self->{input}->readMessageEnd(); |
405
|
|
|
|
|
|
|
|
406
|
0
|
0
|
|
|
|
0
|
if (defined $result->{success} ) { |
407
|
0
|
|
|
|
|
0
|
return $result->{success}; |
408
|
|
|
|
|
|
|
} |
409
|
0
|
0
|
|
|
|
0
|
if (defined $result->{err}) { |
410
|
0
|
|
|
|
|
0
|
die $result->{err}; |
411
|
|
|
|
|
|
|
} |
412
|
0
|
|
|
|
|
0
|
die "getValues failed: unknown result"; |
413
|
|
|
|
|
|
|
} |
414
|
|
|
|
|
|
|
package AggrProcessor; |
415
|
|
|
|
|
|
|
|
416
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
459
|
|
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
sub new { |
420
|
1
|
|
|
1
|
|
16
|
my ($classname, $handler) = @_; |
421
|
1
|
|
|
|
|
2
|
my $self = {}; |
422
|
1
|
|
|
|
|
1
|
$self->{handler} = $handler; |
423
|
1
|
|
|
|
|
2
|
return bless ($self, $classname); |
424
|
|
|
|
|
|
|
} |
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
sub process { |
427
|
6
|
|
|
6
|
|
8
|
my ($self, $input, $output) = @_; |
428
|
6
|
|
|
|
|
7
|
my $rseqid = 0; |
429
|
6
|
|
|
|
|
5
|
my $fname = undef; |
430
|
6
|
|
|
|
|
6
|
my $mtype = 0; |
431
|
|
|
|
|
|
|
|
432
|
6
|
|
|
|
|
12
|
$input->readMessageBegin(\$fname, \$mtype, \$rseqid); |
433
|
6
|
|
|
|
|
8
|
my $methodname = 'process_'.$fname; |
434
|
6
|
50
|
|
|
|
21
|
if (!$self->can($methodname)) { |
435
|
0
|
|
|
|
|
0
|
$input->skip(Thrift::TType::STRUCT); |
436
|
0
|
|
|
|
|
0
|
$input->readMessageEnd(); |
437
|
0
|
|
|
|
|
0
|
my $x = Thrift::TApplicationException->new('Function '.$fname.' not implemented.', Thrift::TApplicationException::UNKNOWN_METHOD); |
438
|
0
|
|
|
|
|
0
|
$output->writeMessageBegin($fname, Thrift::TMessageType::EXCEPTION, $rseqid); |
439
|
0
|
|
|
|
|
0
|
$x->write($output); |
440
|
0
|
|
|
|
|
0
|
$output->writeMessageEnd(); |
441
|
0
|
|
|
|
|
0
|
$output->getTransport()->flush(); |
442
|
0
|
|
|
|
|
0
|
return; |
443
|
|
|
|
|
|
|
} |
444
|
6
|
|
|
|
|
13
|
$self->$methodname($rseqid, $input, $output); |
445
|
6
|
|
|
|
|
19
|
return 1; |
446
|
|
|
|
|
|
|
} |
447
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
sub process_addValue { |
449
|
5
|
|
|
5
|
|
8
|
my ($self, $seqid, $input, $output) = @_; |
450
|
5
|
|
|
|
|
8
|
my $args = Aggr_addValue_args->new(); |
451
|
5
|
|
|
|
|
10
|
$args->read($input); |
452
|
5
|
|
|
|
|
10
|
$input->readMessageEnd(); |
453
|
5
|
|
|
|
|
9
|
my $result = Aggr_addValue_result->new(); |
454
|
5
|
|
|
|
|
15
|
$self->{handler}->addValue($args->value); |
455
|
5
|
|
|
|
|
79
|
$output->writeMessageBegin('addValue', Thrift::TMessageType::REPLY, $seqid); |
456
|
5
|
|
|
|
|
9
|
$result->write($output); |
457
|
5
|
|
|
|
|
9
|
$output->writeMessageEnd(); |
458
|
5
|
|
|
|
|
8
|
$output->getTransport()->flush(); |
459
|
|
|
|
|
|
|
} |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
sub process_getValues { |
462
|
1
|
|
|
1
|
|
3
|
my ($self, $seqid, $input, $output) = @_; |
463
|
1
|
|
|
|
|
2
|
my $args = Aggr_getValues_args->new(); |
464
|
1
|
|
|
|
|
3
|
$args->read($input); |
465
|
1
|
|
|
|
|
3
|
$input->readMessageEnd(); |
466
|
1
|
|
|
|
|
4
|
my $result = Aggr_getValues_result->new(); |
467
|
1
|
|
|
|
|
2
|
eval { |
468
|
1
|
|
|
|
|
4
|
$result->{success} = $self->{handler}->getValues(); |
469
|
1
|
50
|
|
|
|
10
|
}; if( UNIVERSAL::isa($@,'Error') ){ |
470
|
0
|
|
|
|
|
0
|
$result->{err} = $@; |
471
|
0
|
|
|
|
|
0
|
$@ = undef; |
472
|
|
|
|
|
|
|
} |
473
|
1
|
50
|
|
|
|
2
|
if ($@) { |
474
|
0
|
|
|
|
|
0
|
$@ =~ s/^\s+|\s+$//g; |
475
|
0
|
|
|
|
|
0
|
my $err = Thrift::TApplicationException->new("Unexpected Exception: " . $@, Thrift::TApplicationException::INTERNAL_ERROR); |
476
|
0
|
|
|
|
|
0
|
$output->writeMessageBegin('getValues', Thrift::TMessageType::EXCEPTION, $seqid); |
477
|
0
|
|
|
|
|
0
|
$err->write($output); |
478
|
0
|
|
|
|
|
0
|
$output->writeMessageEnd(); |
479
|
0
|
|
|
|
|
0
|
$output->getTransport()->flush(); |
480
|
0
|
|
|
|
|
0
|
$@ = undef; |
481
|
0
|
|
|
|
|
0
|
return; |
482
|
|
|
|
|
|
|
} |
483
|
1
|
|
|
|
|
3
|
$output->writeMessageBegin('getValues', Thrift::TMessageType::REPLY, $seqid); |
484
|
1
|
|
|
|
|
4
|
$result->write($output); |
485
|
1
|
|
|
|
|
2
|
$output->writeMessageEnd(); |
486
|
1
|
|
|
|
|
2
|
$output->getTransport()->flush(); |
487
|
|
|
|
|
|
|
} |
488
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
1; |