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
|
|
|
|
|
|
|
#require 5.6.0; |
21
|
4
|
|
|
4
|
|
25
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
125
|
|
22
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
117
|
|
23
|
|
|
|
|
|
|
|
24
|
4
|
|
|
4
|
|
2393
|
use Thrift; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
147
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# |
27
|
|
|
|
|
|
|
# Transport exceptions |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
package # hide |
30
|
|
|
|
|
|
|
TTransportException; |
31
|
4
|
|
|
4
|
|
19
|
use base('Thrift::TException'); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
2018
|
|
32
|
|
|
|
|
|
|
|
33
|
4
|
|
|
4
|
|
25
|
use constant UNKNOWN => 0; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
174
|
|
34
|
4
|
|
|
4
|
|
20
|
use constant NOT_OPEN => 1; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
212
|
|
35
|
4
|
|
|
4
|
|
52
|
use constant ALREADY_OPEN => 2; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
185
|
|
36
|
4
|
|
|
4
|
|
20
|
use constant TIMED_OUT => 3; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
172
|
|
37
|
4
|
|
|
4
|
|
18
|
use constant END_OF_FILE => 4; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1613
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new{ |
40
|
0
|
|
|
0
|
|
|
my $classname = shift; |
41
|
0
|
|
|
|
|
|
my $self = $classname->SUPER::new(@_); |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
return bless($self,$classname); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
package # hide |
47
|
|
|
|
|
|
|
Thrift::Transport; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# |
50
|
|
|
|
|
|
|
# Whether this transport is open. |
51
|
|
|
|
|
|
|
# |
52
|
|
|
|
|
|
|
# @return boolean true if open |
53
|
|
|
|
|
|
|
# |
54
|
|
|
|
|
|
|
sub isOpen |
55
|
|
|
|
|
|
|
{ |
56
|
0
|
|
|
0
|
0
|
|
die "abstract"; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# |
60
|
|
|
|
|
|
|
# Open the transport for reading/writing |
61
|
|
|
|
|
|
|
# |
62
|
|
|
|
|
|
|
# @throws TTransportException if cannot open |
63
|
|
|
|
|
|
|
# |
64
|
|
|
|
|
|
|
sub open |
65
|
|
|
|
|
|
|
{ |
66
|
0
|
|
|
0
|
0
|
|
die "abstract"; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# |
70
|
|
|
|
|
|
|
# Close the transport. |
71
|
|
|
|
|
|
|
# |
72
|
|
|
|
|
|
|
sub close |
73
|
|
|
|
|
|
|
{ |
74
|
0
|
|
|
0
|
0
|
|
die "abstract"; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# |
78
|
|
|
|
|
|
|
# Read some data into the array. |
79
|
|
|
|
|
|
|
# |
80
|
|
|
|
|
|
|
# @param int $len How much to read |
81
|
|
|
|
|
|
|
# @return string The data that has been read |
82
|
|
|
|
|
|
|
# @throws TTransportException if cannot read any more data |
83
|
|
|
|
|
|
|
# |
84
|
|
|
|
|
|
|
sub read |
85
|
|
|
|
|
|
|
{ |
86
|
0
|
|
|
0
|
0
|
|
my ($len); |
87
|
0
|
|
|
|
|
|
die("abstract"); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# |
91
|
|
|
|
|
|
|
# Guarantees that the full amount of data is read. |
92
|
|
|
|
|
|
|
# |
93
|
|
|
|
|
|
|
# @return string The data, of exact length |
94
|
|
|
|
|
|
|
# @throws TTransportException if cannot read data |
95
|
|
|
|
|
|
|
# |
96
|
|
|
|
|
|
|
sub readAll |
97
|
|
|
|
|
|
|
{ |
98
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
99
|
0
|
|
|
|
|
|
my $len = shift; |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
my $data = ''; |
102
|
0
|
|
|
|
|
|
my $got = 0; |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
while (($got = length($data)) < $len) { |
105
|
0
|
|
|
|
|
|
$data .= $self->read($len - $got); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
0
|
|
|
|
|
|
return $data; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# |
112
|
|
|
|
|
|
|
# Writes the given data out. |
113
|
|
|
|
|
|
|
# |
114
|
|
|
|
|
|
|
# @param string $buf The data to write |
115
|
|
|
|
|
|
|
# @throws TTransportException if writing fails |
116
|
|
|
|
|
|
|
# |
117
|
|
|
|
|
|
|
sub write |
118
|
|
|
|
|
|
|
{ |
119
|
0
|
|
|
0
|
0
|
|
my ($buf); |
120
|
0
|
|
|
|
|
|
die "abstract"; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
# |
124
|
|
|
|
|
|
|
# Flushes any pending data out of a buffer |
125
|
|
|
|
|
|
|
# |
126
|
|
|
|
|
|
|
# @throws TTransportException if a writing error occurs |
127
|
|
|
|
|
|
|
# |
128
|
0
|
|
|
0
|
0
|
|
sub flush {} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
# |
132
|
|
|
|
|
|
|
# TransportFactory creates transport objects from transports |
133
|
|
|
|
|
|
|
# |
134
|
|
|
|
|
|
|
package # hide |
135
|
|
|
|
|
|
|
Thrift::TransportFactory; |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub new { |
138
|
0
|
|
|
0
|
|
|
my $classname = shift; |
139
|
0
|
|
|
|
|
|
my $self = {}; |
140
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
|
return bless($self,$classname); |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
# |
145
|
|
|
|
|
|
|
# Build a transport from the base transport |
146
|
|
|
|
|
|
|
# |
147
|
|
|
|
|
|
|
# @return Thrift::Transport transport |
148
|
|
|
|
|
|
|
# |
149
|
|
|
|
|
|
|
sub getTransport |
150
|
|
|
|
|
|
|
{ |
151
|
0
|
|
|
0
|
|
|
my $self = shift; |
152
|
0
|
|
|
|
|
|
my $trans = shift; |
153
|
|
|
|
|
|
|
|
154
|
0
|
|
|
|
|
|
return $trans; |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# |
159
|
|
|
|
|
|
|
# ServerTransport base class module |
160
|
|
|
|
|
|
|
# |
161
|
|
|
|
|
|
|
package # hide |
162
|
|
|
|
|
|
|
Thrift::ServerTransport; |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
sub listen |
165
|
|
|
|
|
|
|
{ |
166
|
0
|
|
|
0
|
|
|
die "abstract"; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub accept |
170
|
|
|
|
|
|
|
{ |
171
|
0
|
|
|
0
|
|
|
die "abstract"; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub close |
175
|
|
|
|
|
|
|
{ |
176
|
0
|
|
|
0
|
|
|
die "abstract"; |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
1; |
181
|
|
|
|
|
|
|
|