line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Autogenerated by Thrift Compiler (0.14.0) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
5
|
|
|
|
|
|
|
# |
6
|
1
|
|
|
1
|
|
491
|
use 5.10.0; |
|
1
|
|
|
|
|
4
|
|
7
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
29
|
|
9
|
1
|
|
|
1
|
|
6
|
use Thrift::Exception; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
10
|
1
|
|
|
1
|
|
6
|
use Thrift::MessageType; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
11
|
1
|
|
|
1
|
|
5
|
use Thrift::Type; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
6
|
use Types; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# HELPER FUNCTIONS AND STRUCTURES |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package Aggr_addValue_args; |
19
|
1
|
|
|
1
|
|
7
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
513
|
|
20
|
|
|
|
|
|
|
Aggr_addValue_args->mk_accessors( qw( value ) ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
10
|
|
|
10
|
|
14
|
my $classname = shift; |
24
|
10
|
|
|
|
|
14
|
my $self = {}; |
25
|
10
|
|
50
|
|
|
32
|
my $vals = shift || {}; |
26
|
10
|
|
|
|
|
18
|
$self->{value} = undef; |
27
|
10
|
50
|
|
|
|
24
|
if (UNIVERSAL::isa($vals,'HASH')) { |
28
|
10
|
50
|
|
|
|
31
|
if (defined $vals->{value}) { |
29
|
0
|
|
|
|
|
0
|
$self->{value} = $vals->{value}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
10
|
|
|
|
|
23
|
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
|
|
7
|
my ($self, $input) = @_; |
41
|
5
|
|
|
|
|
6
|
my $xfer = 0; |
42
|
5
|
|
|
|
|
5
|
my $fname; |
43
|
5
|
|
|
|
|
6
|
my $ftype = 0; |
44
|
5
|
|
|
|
|
5
|
my $fid = 0; |
45
|
5
|
|
|
|
|
16
|
$xfer += $input->readStructBegin(\$fname); |
46
|
5
|
|
|
|
|
5
|
while (1) |
47
|
|
|
|
|
|
|
{ |
48
|
10
|
|
|
|
|
24
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
49
|
10
|
100
|
|
|
|
19
|
if ($ftype == Thrift::TType::STOP) { |
50
|
5
|
|
|
|
|
6
|
last; |
51
|
|
|
|
|
|
|
} |
52
|
5
|
|
|
|
|
10
|
SWITCH: for($fid) |
53
|
|
|
|
|
|
|
{ |
54
|
5
|
50
|
|
|
|
31
|
/^1$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
5
|
50
|
|
|
|
19
|
|
55
|
5
|
|
|
|
|
19
|
$xfer += $input->readI32(\$self->{value}); |
56
|
|
|
|
|
|
|
} else { |
57
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
58
|
|
|
|
|
|
|
} |
59
|
5
|
|
|
|
|
9
|
last; }; |
60
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
61
|
|
|
|
|
|
|
} |
62
|
5
|
|
|
|
|
12
|
$xfer += $input->readFieldEnd(); |
63
|
|
|
|
|
|
|
} |
64
|
5
|
|
|
|
|
11
|
$xfer += $input->readStructEnd(); |
65
|
5
|
|
|
|
|
8
|
return $xfer; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub write { |
69
|
5
|
|
|
5
|
|
7
|
my ($self, $output) = @_; |
70
|
5
|
|
|
|
|
5
|
my $xfer = 0; |
71
|
5
|
|
|
|
|
15
|
$xfer += $output->writeStructBegin('Aggr_addValue_args'); |
72
|
5
|
50
|
|
|
|
11
|
if (defined $self->{value}) { |
73
|
5
|
|
|
|
|
13
|
$xfer += $output->writeFieldBegin('value', Thrift::TType::I32, 1); |
74
|
5
|
|
|
|
|
15
|
$xfer += $output->writeI32($self->{value}); |
75
|
5
|
|
|
|
|
11
|
$xfer += $output->writeFieldEnd(); |
76
|
|
|
|
|
|
|
} |
77
|
5
|
|
|
|
|
11
|
$xfer += $output->writeFieldStop(); |
78
|
5
|
|
|
|
|
9
|
$xfer += $output->writeStructEnd(); |
79
|
5
|
|
|
|
|
8
|
return $xfer; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
package Aggr_addValue_result; |
83
|
1
|
|
|
1
|
|
7
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
340
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub new { |
86
|
10
|
|
|
10
|
|
29
|
my $classname = shift; |
87
|
10
|
|
|
|
|
15
|
my $self = {}; |
88
|
10
|
|
50
|
|
|
28
|
my $vals = shift || {}; |
89
|
10
|
|
|
|
|
23
|
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
|
|
|
|
|
6
|
my $xfer = 0; |
99
|
5
|
|
|
|
|
5
|
my $fname; |
100
|
5
|
|
|
|
|
6
|
my $ftype = 0; |
101
|
5
|
|
|
|
|
6
|
my $fid = 0; |
102
|
5
|
|
|
|
|
24
|
$xfer += $input->readStructBegin(\$fname); |
103
|
5
|
|
|
|
|
5
|
while (1) |
104
|
|
|
|
|
|
|
{ |
105
|
5
|
|
|
|
|
14
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
106
|
5
|
50
|
|
|
|
12
|
if ($ftype == Thrift::TType::STOP) { |
107
|
5
|
|
|
|
|
6
|
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
|
|
|
|
|
11
|
$xfer += $input->readStructEnd(); |
116
|
5
|
|
|
|
|
8
|
return $xfer; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub write { |
120
|
5
|
|
|
5
|
|
8
|
my ($self, $output) = @_; |
121
|
5
|
|
|
|
|
5
|
my $xfer = 0; |
122
|
5
|
|
|
|
|
10
|
$xfer += $output->writeStructBegin('Aggr_addValue_result'); |
123
|
5
|
|
|
|
|
12
|
$xfer += $output->writeFieldStop(); |
124
|
5
|
|
|
|
|
11
|
$xfer += $output->writeStructEnd(); |
125
|
5
|
|
|
|
|
6
|
return $xfer; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
package Aggr_getValues_args; |
129
|
1
|
|
|
1
|
|
7
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
378
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub new { |
132
|
2
|
|
|
2
|
|
4
|
my $classname = shift; |
133
|
2
|
|
|
|
|
5
|
my $self = {}; |
134
|
2
|
|
50
|
|
|
9
|
my $vals = shift || {}; |
135
|
2
|
|
|
|
|
6
|
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
|
|
2
|
my ($self, $input) = @_; |
144
|
1
|
|
|
|
|
2
|
my $xfer = 0; |
145
|
1
|
|
|
|
|
2
|
my $fname; |
146
|
1
|
|
|
|
|
2
|
my $ftype = 0; |
147
|
1
|
|
|
|
|
2
|
my $fid = 0; |
148
|
1
|
|
|
|
|
3
|
$xfer += $input->readStructBegin(\$fname); |
149
|
1
|
|
|
|
|
2
|
while (1) |
150
|
|
|
|
|
|
|
{ |
151
|
1
|
|
|
|
|
3
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
152
|
1
|
50
|
|
|
|
4
|
if ($ftype == Thrift::TType::STOP) { |
153
|
1
|
|
|
|
|
1
|
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
|
|
|
|
|
4
|
$xfer += $input->readStructEnd(); |
162
|
1
|
|
|
|
|
2
|
return $xfer; |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub write { |
166
|
1
|
|
|
1
|
|
3
|
my ($self, $output) = @_; |
167
|
1
|
|
|
|
|
3
|
my $xfer = 0; |
168
|
1
|
|
|
|
|
4
|
$xfer += $output->writeStructBegin('Aggr_getValues_args'); |
169
|
1
|
|
|
|
|
3
|
$xfer += $output->writeFieldStop(); |
170
|
1
|
|
|
|
|
3
|
$xfer += $output->writeStructEnd(); |
171
|
1
|
|
|
|
|
12
|
return $xfer; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
package Aggr_getValues_result; |
175
|
1
|
|
|
1
|
|
8
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
734
|
|
176
|
|
|
|
|
|
|
Aggr_getValues_result->mk_accessors( qw( success ) ); |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
sub new { |
179
|
2
|
|
|
2
|
|
7
|
my $classname = shift; |
180
|
2
|
|
|
|
|
4
|
my $self = {}; |
181
|
2
|
|
50
|
|
|
19
|
my $vals = shift || {}; |
182
|
2
|
|
|
|
|
5
|
$self->{success} = undef; |
183
|
2
|
|
|
|
|
3
|
$self->{err} = undef; |
184
|
2
|
50
|
|
|
|
15
|
if (UNIVERSAL::isa($vals,'HASH')) { |
185
|
2
|
50
|
|
|
|
6
|
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
|
|
|
|
|
6
|
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
|
|
6
|
my ($self, $input) = @_; |
201
|
1
|
|
|
|
|
2
|
my $xfer = 0; |
202
|
1
|
|
|
|
|
1
|
my $fname; |
203
|
1
|
|
|
|
|
2
|
my $ftype = 0; |
204
|
1
|
|
|
|
|
1
|
my $fid = 0; |
205
|
1
|
|
|
|
|
3
|
$xfer += $input->readStructBegin(\$fname); |
206
|
1
|
|
|
|
|
2
|
while (1) |
207
|
|
|
|
|
|
|
{ |
208
|
2
|
|
|
|
|
6
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
209
|
2
|
100
|
|
|
|
7
|
if ($ftype == Thrift::TType::STOP) { |
210
|
1
|
|
|
|
|
2
|
last; |
211
|
|
|
|
|
|
|
} |
212
|
1
|
|
|
|
|
3
|
SWITCH: for($fid) |
213
|
|
|
|
|
|
|
{ |
214
|
1
|
50
|
|
|
|
6
|
/^0$/ && do{ if ($ftype == Thrift::TType::LIST) { |
|
1
|
50
|
|
|
|
5
|
|
215
|
|
|
|
|
|
|
{ |
216
|
1
|
|
|
|
|
2
|
my $_size0 = 0; |
|
1
|
|
|
|
|
1
|
|
217
|
1
|
|
|
|
|
13
|
$self->{success} = []; |
218
|
1
|
|
|
|
|
3
|
my $_etype3 = 0; |
219
|
1
|
|
|
|
|
9
|
$xfer += $input->readListBegin(\$_etype3, \$_size0); |
220
|
1
|
|
|
|
|
4
|
for (my $_i4 = 0; $_i4 < $_size0; ++$_i4) |
221
|
|
|
|
|
|
|
{ |
222
|
5
|
|
|
|
|
7
|
my $elem5 = undef; |
223
|
5
|
|
|
|
|
20
|
$xfer += $input->readI32(\$elem5); |
224
|
5
|
|
|
|
|
6
|
push(@{$self->{success}},$elem5); |
|
5
|
|
|
|
|
13
|
|
225
|
|
|
|
|
|
|
} |
226
|
1
|
|
|
|
|
8
|
$xfer += $input->readListEnd(); |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
} else { |
229
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
230
|
|
|
|
|
|
|
} |
231
|
1
|
|
|
|
|
3
|
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
|
|
|
|
|
12
|
return $xfer; |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
sub write { |
248
|
1
|
|
|
1
|
|
2
|
my ($self, $output) = @_; |
249
|
1
|
|
|
|
|
2
|
my $xfer = 0; |
250
|
1
|
|
|
|
|
3
|
$xfer += $output->writeStructBegin('Aggr_getValues_result'); |
251
|
1
|
50
|
|
|
|
3
|
if (defined $self->{success}) { |
252
|
1
|
|
|
|
|
4
|
$xfer += $output->writeFieldBegin('success', Thrift::TType::LIST, 0); |
253
|
|
|
|
|
|
|
{ |
254
|
1
|
|
|
|
|
2
|
$xfer += $output->writeListBegin(Thrift::TType::I32, scalar(@{$self->{success}})); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
255
|
|
|
|
|
|
|
{ |
256
|
1
|
|
|
|
|
2
|
foreach my $iter6 (@{$self->{success}}) |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
257
|
|
|
|
|
|
|
{ |
258
|
5
|
|
|
|
|
9
|
$xfer += $output->writeI32($iter6); |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
} |
261
|
1
|
|
|
|
|
4
|
$xfer += $output->writeListEnd(); |
262
|
|
|
|
|
|
|
} |
263
|
1
|
|
|
|
|
3
|
$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
|
|
|
|
|
4
|
$xfer += $output->writeFieldStop(); |
271
|
1
|
|
|
|
|
3
|
$xfer += $output->writeStructEnd(); |
272
|
1
|
|
|
|
|
1
|
return $xfer; |
273
|
|
|
|
|
|
|
} |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
package AggrIf; |
276
|
|
|
|
|
|
|
|
277
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
97
|
|
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
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
160
|
|
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
|
|
7
|
use base qw(AggrIf); |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
1054
|
|
322
|
|
|
|
|
|
|
sub new { |
323
|
1
|
|
|
1
|
|
10
|
my ($classname, $input, $output) = @_; |
324
|
1
|
|
|
|
|
2
|
my $self = {}; |
325
|
1
|
|
|
|
|
3
|
$self->{input} = $input; |
326
|
1
|
50
|
|
|
|
5
|
$self->{output} = defined $output ? $output : $input; |
327
|
1
|
|
|
|
|
3
|
$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
|
|
25
|
my $self = shift; |
341
|
5
|
|
|
|
|
6
|
my $value = shift; |
342
|
|
|
|
|
|
|
|
343
|
5
|
|
|
|
|
18
|
$self->{output}->writeMessageBegin('addValue', Thrift::TMessageType::CALL, $self->{seqid}); |
344
|
5
|
|
|
|
|
13
|
my $args = Aggr_addValue_args->new(); |
345
|
5
|
|
|
|
|
12
|
$args->{value} = $value; |
346
|
5
|
|
|
|
|
13
|
$args->write($self->{output}); |
347
|
5
|
|
|
|
|
25
|
$self->{output}->writeMessageEnd(); |
348
|
5
|
|
|
|
|
11
|
$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
|
|
7
|
my $self = shift; |
380
|
|
|
|
|
|
|
|
381
|
1
|
|
|
|
|
5
|
$self->{output}->writeMessageBegin('getValues', Thrift::TMessageType::CALL, $self->{seqid}); |
382
|
1
|
|
|
|
|
42
|
my $args = Aggr_getValues_args->new(); |
383
|
1
|
|
|
|
|
5
|
$args->write($self->{output}); |
384
|
1
|
|
|
|
|
4
|
$self->{output}->writeMessageEnd(); |
385
|
1
|
|
|
|
|
4
|
$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
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
553
|
|
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
sub new { |
420
|
1
|
|
|
1
|
|
17
|
my ($classname, $handler) = @_; |
421
|
1
|
|
|
|
|
2
|
my $self = {}; |
422
|
1
|
|
|
|
|
12
|
$self->{handler} = $handler; |
423
|
1
|
|
|
|
|
4
|
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
|
|
|
|
|
7
|
my $fname = undef; |
430
|
6
|
|
|
|
|
6
|
my $mtype = 0; |
431
|
|
|
|
|
|
|
|
432
|
6
|
|
|
|
|
17
|
$input->readMessageBegin(\$fname, \$mtype, \$rseqid); |
433
|
6
|
|
|
|
|
9
|
my $methodname = 'process_'.$fname; |
434
|
6
|
50
|
|
|
|
24
|
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
|
|
|
|
|
18
|
$self->$methodname($rseqid, $input, $output); |
445
|
6
|
|
|
|
|
15
|
return 1; |
446
|
|
|
|
|
|
|
} |
447
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
sub process_addValue { |
449
|
5
|
|
|
5
|
|
8
|
my ($self, $seqid, $input, $output) = @_; |
450
|
5
|
|
|
|
|
9
|
my $args = Aggr_addValue_args->new(); |
451
|
5
|
|
|
|
|
12
|
$args->read($input); |
452
|
5
|
|
|
|
|
22
|
$input->readMessageEnd(); |
453
|
5
|
|
|
|
|
12
|
my $result = Aggr_addValue_result->new(); |
454
|
5
|
|
|
|
|
18
|
$self->{handler}->addValue($args->value); |
455
|
5
|
|
|
|
|
95
|
$output->writeMessageBegin('addValue', Thrift::TMessageType::REPLY, $seqid); |
456
|
5
|
|
|
|
|
12
|
$result->write($output); |
457
|
5
|
|
|
|
|
11
|
$output->writeMessageEnd(); |
458
|
5
|
|
|
|
|
11
|
$output->getTransport()->flush(); |
459
|
|
|
|
|
|
|
} |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
sub process_getValues { |
462
|
1
|
|
|
1
|
|
3
|
my ($self, $seqid, $input, $output) = @_; |
463
|
1
|
|
|
|
|
3
|
my $args = Aggr_getValues_args->new(); |
464
|
1
|
|
|
|
|
4
|
$args->read($input); |
465
|
1
|
|
|
|
|
3
|
$input->readMessageEnd(); |
466
|
1
|
|
|
|
|
6
|
my $result = Aggr_getValues_result->new(); |
467
|
1
|
|
|
|
|
2
|
eval { |
468
|
1
|
|
|
|
|
5
|
$result->{success} = $self->{handler}->getValues(); |
469
|
1
|
50
|
|
|
|
12
|
}; if( UNIVERSAL::isa($@,'Error') ){ |
470
|
0
|
|
|
|
|
0
|
$result->{err} = $@; |
471
|
0
|
|
|
|
|
0
|
$@ = undef; |
472
|
|
|
|
|
|
|
} |
473
|
1
|
50
|
|
|
|
3
|
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
|
|
|
|
|
5
|
$output->writeMessageBegin('getValues', Thrift::TMessageType::REPLY, $seqid); |
484
|
1
|
|
|
|
|
6
|
$result->write($output); |
485
|
1
|
|
|
|
|
3
|
$output->writeMessageEnd(); |
486
|
1
|
|
|
|
|
3
|
$output->getTransport()->flush(); |
487
|
|
|
|
|
|
|
} |
488
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
1; |