| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# |
|
2
|
|
|
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one |
|
3
|
|
|
|
|
|
|
# or more contributor license agreements. See the NOTICE file |
|
4
|
|
|
|
|
|
|
# distributed with this work for additional information |
|
5
|
|
|
|
|
|
|
# regarding copyright ownership. The ASF licenses this file |
|
6
|
|
|
|
|
|
|
# to you under the Apache License, Version 2.0 (the |
|
7
|
|
|
|
|
|
|
# "License"); you may not use this file except in compliance |
|
8
|
|
|
|
|
|
|
# with the License. You may obtain a copy of the License at |
|
9
|
|
|
|
|
|
|
# |
|
10
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
|
11
|
|
|
|
|
|
|
# |
|
12
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, |
|
13
|
|
|
|
|
|
|
# software distributed under the License is distributed on an |
|
14
|
|
|
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
15
|
|
|
|
|
|
|
# KIND, either express or implied. See the License for the |
|
16
|
|
|
|
|
|
|
# specific language governing permissions and limitations |
|
17
|
|
|
|
|
|
|
# under the License. |
|
18
|
|
|
|
|
|
|
# |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.6.0-dev'; |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
##require 5.6.0; |
|
23
|
4
|
|
|
4
|
|
23
|
use strict; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
137
|
|
|
24
|
4
|
|
|
4
|
|
23
|
use warnings; |
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
176
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# |
|
27
|
|
|
|
|
|
|
# Data types that can be sent via Thrift |
|
28
|
|
|
|
|
|
|
# |
|
29
|
|
|
|
|
|
|
package # hide |
|
30
|
|
|
|
|
|
|
TType; |
|
31
|
4
|
|
|
4
|
|
23
|
use constant STOP => 0; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
517
|
|
|
32
|
4
|
|
|
4
|
|
21
|
use constant VOID => 1; |
|
|
4
|
|
|
|
|
37
|
|
|
|
4
|
|
|
|
|
185
|
|
|
33
|
4
|
|
|
4
|
|
19
|
use constant BOOL => 2; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
179
|
|
|
34
|
4
|
|
|
4
|
|
18
|
use constant BYTE => 3; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
155
|
|
|
35
|
4
|
|
|
4
|
|
19
|
use constant I08 => 3; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
166
|
|
|
36
|
4
|
|
|
4
|
|
19
|
use constant DOUBLE => 4; |
|
|
4
|
|
|
|
|
35
|
|
|
|
4
|
|
|
|
|
162
|
|
|
37
|
4
|
|
|
4
|
|
24
|
use constant I16 => 6; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
208
|
|
|
38
|
4
|
|
|
4
|
|
21
|
use constant I32 => 8; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
162
|
|
|
39
|
4
|
|
|
4
|
|
24
|
use constant I64 => 10; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
200
|
|
|
40
|
4
|
|
|
4
|
|
20
|
use constant STRING => 11; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
204
|
|
|
41
|
4
|
|
|
4
|
|
20
|
use constant UTF7 => 11; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
177
|
|
|
42
|
4
|
|
|
4
|
|
35
|
use constant STRUCT => 12; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
163
|
|
|
43
|
4
|
|
|
4
|
|
19
|
use constant MAP => 13; |
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
195
|
|
|
44
|
4
|
|
|
4
|
|
21
|
use constant SET => 14; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
169
|
|
|
45
|
4
|
|
|
4
|
|
19
|
use constant LIST => 15; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
260
|
|
|
46
|
4
|
|
|
4
|
|
20
|
use constant UTF8 => 16; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
175
|
|
|
47
|
4
|
|
|
4
|
|
30
|
use constant UTF16 => 17; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
227
|
|
|
48
|
|
|
|
|
|
|
1; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# |
|
51
|
|
|
|
|
|
|
# Message types for RPC |
|
52
|
|
|
|
|
|
|
# |
|
53
|
|
|
|
|
|
|
package # hide |
|
54
|
|
|
|
|
|
|
TMessageType; |
|
55
|
4
|
|
|
4
|
|
18
|
use constant CALL => 1; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
192
|
|
|
56
|
4
|
|
|
4
|
|
18
|
use constant REPLY => 2; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
156
|
|
|
57
|
4
|
|
|
4
|
|
18
|
use constant EXCEPTION => 3; |
|
|
4
|
|
|
|
|
12
|
|
|
|
4
|
|
|
|
|
843
|
|
|
58
|
4
|
|
|
4
|
|
21
|
use constant ONEWAY => 4; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
454
|
|
|
59
|
|
|
|
|
|
|
1; |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
package # hide |
|
62
|
|
|
|
|
|
|
Thrift::TException; |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub new { |
|
65
|
0
|
|
|
0
|
|
|
my $classname = shift; |
|
66
|
0
|
|
0
|
|
|
|
my $self = {message => shift, code => shift || 0}; |
|
67
|
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
return bless($self,$classname); |
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
1; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
package # hide |
|
73
|
|
|
|
|
|
|
TApplicationException; |
|
74
|
4
|
|
|
4
|
|
19
|
use base('Thrift::TException'); |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
2284
|
|
|
75
|
|
|
|
|
|
|
|
|
76
|
4
|
|
|
4
|
|
52
|
use constant UNKNOWN => 0; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
282
|
|
|
77
|
4
|
|
|
4
|
|
21
|
use constant UNKNOWN_METHOD => 1; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
176
|
|
|
78
|
4
|
|
|
4
|
|
19
|
use constant INVALID_MESSAGE_TYPE => 2; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
162
|
|
|
79
|
4
|
|
|
4
|
|
18
|
use constant WRONG_METHOD_NAME => 3; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
178
|
|
|
80
|
4
|
|
|
4
|
|
17
|
use constant BAD_SEQUENCE_ID => 4; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
167
|
|
|
81
|
4
|
|
|
4
|
|
21
|
use constant MISSING_RESULT => 5; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
2170
|
|
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub new { |
|
84
|
0
|
|
|
0
|
|
|
my $classname = shift; |
|
85
|
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
my $self = $classname->SUPER::new(); |
|
87
|
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
return bless($self,$classname); |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub read { |
|
92
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
93
|
0
|
|
|
|
|
|
my $input = shift; |
|
94
|
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
my $xfer = 0; |
|
96
|
0
|
|
|
|
|
|
my $fname = undef; |
|
97
|
0
|
|
|
|
|
|
my $ftype = 0; |
|
98
|
0
|
|
|
|
|
|
my $fid = 0; |
|
99
|
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
$xfer += $input->readStructBegin(\$fname); |
|
101
|
|
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
while (1) |
|
103
|
|
|
|
|
|
|
{ |
|
104
|
0
|
|
|
|
|
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
|
105
|
0
|
0
|
|
|
|
|
if ($ftype == TType::STOP) { |
|
106
|
0
|
|
|
|
|
|
last; next; |
|
|
0
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
} |
|
108
|
|
|
|
|
|
|
|
|
109
|
0
|
|
|
|
|
|
SWITCH: for($fid) |
|
110
|
|
|
|
|
|
|
{ |
|
111
|
0
|
0
|
|
|
|
|
/1/ && do{ |
|
112
|
|
|
|
|
|
|
|
|
113
|
0
|
0
|
|
|
|
|
if ($ftype == TType::STRING) { |
|
114
|
0
|
|
|
|
|
|
$xfer += $input->readString(\$self->{message}); |
|
115
|
|
|
|
|
|
|
} else { |
|
116
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
|
117
|
|
|
|
|
|
|
} |
|
118
|
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
|
last; |
|
120
|
|
|
|
|
|
|
}; |
|
121
|
|
|
|
|
|
|
|
|
122
|
0
|
0
|
|
|
|
|
/2/ && do{ |
|
123
|
0
|
0
|
|
|
|
|
if ($ftype == TType::I32) { |
|
124
|
0
|
|
|
|
|
|
$xfer += $input->readI32(\$self->{code}); |
|
125
|
|
|
|
|
|
|
} else { |
|
126
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
|
127
|
|
|
|
|
|
|
} |
|
128
|
0
|
|
|
|
|
|
last; |
|
129
|
|
|
|
|
|
|
}; |
|
130
|
|
|
|
|
|
|
|
|
131
|
0
|
|
|
|
|
|
$xfer += $input->skip($ftype); |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
0
|
|
|
|
|
|
$xfer += $input->readFieldEnd(); |
|
135
|
|
|
|
|
|
|
} |
|
136
|
0
|
|
|
|
|
|
$xfer += $input->readStructEnd(); |
|
137
|
|
|
|
|
|
|
|
|
138
|
0
|
|
|
|
|
|
return $xfer; |
|
139
|
|
|
|
|
|
|
} |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub write { |
|
142
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
143
|
0
|
|
|
|
|
|
my $output = shift; |
|
144
|
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
|
my $xfer = 0; |
|
146
|
|
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
|
$xfer += $output->writeStructBegin('TApplicationException'); |
|
148
|
|
|
|
|
|
|
|
|
149
|
0
|
0
|
|
|
|
|
if ($self->getMessage()) { |
|
150
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('message', TType::STRING, 1); |
|
151
|
0
|
|
|
|
|
|
$xfer += $output->writeString($self->getMessage()); |
|
152
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
|
153
|
|
|
|
|
|
|
} |
|
154
|
|
|
|
|
|
|
|
|
155
|
0
|
0
|
|
|
|
|
if ($self->getCode()) { |
|
156
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldBegin('type', TType::I32, 2); |
|
157
|
0
|
|
|
|
|
|
$xfer += $output->writeI32($self->getCode()); |
|
158
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldEnd(); |
|
159
|
|
|
|
|
|
|
} |
|
160
|
|
|
|
|
|
|
|
|
161
|
0
|
|
|
|
|
|
$xfer += $output->writeFieldStop(); |
|
162
|
0
|
|
|
|
|
|
$xfer += $output->writeStructEnd(); |
|
163
|
|
|
|
|
|
|
|
|
164
|
0
|
|
|
|
|
|
return $xfer; |
|
165
|
|
|
|
|
|
|
} |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub getMessage |
|
168
|
|
|
|
|
|
|
{ |
|
169
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
170
|
|
|
|
|
|
|
|
|
171
|
0
|
|
|
|
|
|
return $self->{message}; |
|
172
|
|
|
|
|
|
|
} |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub getCode |
|
175
|
|
|
|
|
|
|
{ |
|
176
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
177
|
|
|
|
|
|
|
|
|
178
|
0
|
|
|
|
|
|
return $self->{code}; |
|
179
|
|
|
|
|
|
|
} |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
1; |