blib/lib/Cassandra/Client/Protocol.pm

filter: Statementstmt 43.5% 85 / 195 Branchbran 27.2% 18 / 66 Conditioncond 10.0% 4 / 40 MC/DCmcdc 11.7% 2 / 17 Subroutinesub 48.5% 17 / 35 Podpod 0.0% 0 / 24 totaltotal 33.4% 126 / 377 CC 57 SCAR 40.5
CC
57
Cov
36%
pack_queryparameters
272.0
unpack_errordata
42.0
bigint_to_bytes
30.0
CRAP 57.1
« blib/lib/Cassandra/Client/Connection.pm ↑ Summary blib/lib/Cassandra/Client/Pool.pm »
1 package Cassandra::Client::Protocol;
2 13 our $AUTHORITY = 'cpan:TVDW';
3 13 $Cassandra::Client::Protocol::VERSION = '0.21';
4 13 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 13 ▶use Encode;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 13 require Exporter;
11 13 our @ISA= qw(Exporter);
12  
13 13 ▶use Cassandra::Client::Error::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 13 ▶use Cassandra::Client::Error::ReadTimeoutException;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 13 ▶use Cassandra::Client::Error::WriteTimeoutException;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 13 ▶use Cassandra::Client::Error::UnavailableException;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 13 ▶use constant BIGINT_SUPPORTED => eval { unpack('q>', "\0\0\0\0\0\0\0\1") };
Subroutine BEGIN: called CC=1 SCAR=0.0
19 13 ▶use if !BIGINT_SUPPORTED, 'Math::BigInt';
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 13 our (@EXPORT_OK, %EXPORT_TAGS);
22 13 our (%consistency_lookup, %batch_type_lookup);
23 13 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
24 13 my %constants= (
25 OPCODE_ERROR => 0,
26 OPCODE_STARTUP => 1,
27 OPCODE_READY => 2,
28 OPCODE_AUTHENTICATE => 3,
29 OPCODE_OPTIONS => 5,
30 OPCODE_SUPPORTED => 6,
31 OPCODE_QUERY => 7,
32 OPCODE_RESULT => 8,
33 OPCODE_PREPARE => 9,
34 OPCODE_EXECUTE => 10,
35 OPCODE_REGISTER => 11,
36 OPCODE_EVENT => 12,
37 OPCODE_BATCH => 13,
38 OPCODE_AUTH_CHALLENGE => 14,
39 OPCODE_AUTH_RESPONSE => 15,
40 OPCODE_AUTH_SUCCESS => 16,
41  
42 RESULT_VOID => 1,
43 RESULT_ROWS => 2,
44 RESULT_SET_KEYSPACE => 3,
45 RESULT_PREPARED => 4,
46 RESULT_SCHEMA_CHANGE => 5,
47  
48 CONSISTENCY_ANY => 0,
49 CONSISTENCY_ONE => 1,
50 CONSISTENCY_TWO => 2,
51 CONSISTENCY_THREE => 3,
52 CONSISTENCY_QUORUM => 4,
53 CONSISTENCY_ALL => 5,
54 CONSISTENCY_LOCAL_QUORUM => 6,
55 CONSISTENCY_EACH_QUORUM => 7,
56 CONSISTENCY_SERIAL => 8,
57 CONSISTENCY_LOCAL_SERIAL => 9,
58 CONSISTENCY_LOCAL_ONE => 10,
59  
60 TYPE_CUSTOM => 0x00,
61 TYPE_ASCII => 0x01,
62 TYPE_BIGINT => 0x02,
63 TYPE_BLOB => 0x03,
64 TYPE_BOOLEAN => 0x04,
65 TYPE_COUNTER => 0x05,
66 TYPE_DECIMAL => 0x06,
67 TYPE_DOUBLE => 0x07,
68 TYPE_FLOAT => 0x08,
69 TYPE_INT => 0x09,
70 TYPE_TEXT => 0x0A, # deprecated/removed
71 TYPE_TIMESTAMP => 0x0B,
72 TYPE_UUID => 0x0C,
73 TYPE_VARCHAR => 0x0D,
74 TYPE_VARINT => 0x0E,
75 TYPE_TIMEUUID => 0x0F,
76 TYPE_INET => 0x10,
77 TYPE_DATE => 0x11,
78 TYPE_TIME => 0x12,
79 TYPE_SMALLINT => 0x13,
80 TYPE_TINYINT => 0x14,
81 TYPE_LIST => 0x20,
82 TYPE_MAP => 0x21,
83 TYPE_SET => 0x22,
84 TYPE_UDT => 0x30,
85 TYPE_TUPLE => 0x31,
86 );
87  
88 13 @EXPORT_OK= (
89 keys %constants,
90 qw/
91 pack_int unpack_int
92 pack_long
93 pack_short unpack_short
94 pack_string unpack_string
95 pack_longstring
96 pack_stringlist unpack_stringlist
97 pack_bytes unpack_bytes
98 pack_shortbytes unpack_shortbytes
99 pack_option_type
100 pack_stringmap
101 pack_stringmultimap unpack_stringmultimap
102 unpack_inet
103 unpack_char
104  
105 pack_metadata unpack_metadata
106 unpack_errordata
107 pack_queryparameters
108  
109 %consistency_lookup
110 %batch_type_lookup
111  
112 BIGINT_SUPPORTED
113 /
114 );
115  
116 13 %EXPORT_TAGS= (
117 constants => [ keys %constants ],
118 all => [ @EXPORT_OK ]
119 );
120  
121 %consistency_lookup= map {
122 143 my $key= $_;
123 143 $key =~ s/CONSISTENCY_//;
124 143 (lc $key) => $constants{$_}
125 13 } grep { /CONSISTENCY/ } keys %constants;
126  
127 13 %batch_type_lookup= (
128 logged => 0,
129 unlogged => 1,
130 counter => 2,
131 );
132  
133 13 constant->import( { %constants } );
134 }
135  
136 # TYPE: int
137 222 ▶sub pack_int {
Subroutine pack_int: called CC=1 SCAR=0.0
Pod undocumented
138 222 pack('l>', $_[0])
139 }
140  
141 0 ▶sub unpack_int {
Subroutine unpack_int: not called CC=1 SCAR=6.9
Pod undocumented
142 0 unpack('l>', substr $_[0], 0, 4, '')
143 }
144  
145 # TYPE: long
146 1 ▶sub pack_long {
Subroutine pack_long: called CC=1 SCAR=0.0
Pod undocumented
147 1 if (BIGINT_SUPPORTED) {
148 1 return pack('q>', $_[0]);
149 } else {
150 return bigint_to_bytes($_[0]);
151 }
152 }
153  
154 # TYPE: short
155 355 ▶sub pack_short {
Subroutine pack_short: called CC=1 SCAR=0.0
Pod undocumented
156 355 pack('n', $_[0])
157 }
158  
159 0 ▶sub unpack_short {
Subroutine unpack_short: not called CC=1 SCAR=6.9
Pod undocumented
160 0 unpack('n', substr $_[0], 0, 2, '')
161 }
162  
163 # TYPE: char
164 0 ▶sub unpack_char {
Subroutine unpack_char: not called CC=1 SCAR=6.9
Pod undocumented
165 0 unpack('c', substr $_[0], 0, 1, '')
166 }
167  
168 # TYPE: string
169 943 ▶sub pack_string {
Subroutine pack_string: called CC=2 SCAR=10.1
Pod undocumented
170 943 ▶ if (utf8::is_utf8($_[0])) {
Branch: 1 branch
BranchTrueFalseTotal
if (utf8::is_utf8($_[0])) 0 943 943
171 0 my $str= $_[0]; # copy
172 0 utf8::encode $str;
173 0 return pack('n/a', $str);
174 }
175  
176 943 return pack('n/a', $_[0]);
177 }
178  
179 0 ▶sub unpack_string {
Subroutine unpack_string: not called CC=2 SCAR=17.9
Pod undocumented
180 0 my $length= &unpack_short;
181 0 ▶ if ($length > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($length > 0) { } 0 0 0
182 0 my $string= substr($_[0], 0, $length, '');
183 0 utf8::decode $string;
184 0 return $string;
185 } else {
186 0 return '';
187 }
188 }
189  
190 # TYPE: longstring
191 0 ▶sub pack_longstring {
Subroutine pack_longstring: not called CC=2 SCAR=17.9
Pod undocumented
192 0 ▶ if (utf8::is_utf8($_[0])) {
Branch: 1 branch
BranchTrueFalseTotal
if (utf8::is_utf8($_[0])) 0 0 0
193 0 my $str= $_[0]; # copy
194 0 utf8::encode $str;
195 0 return pack('l>/a', $str);
196 }
197  
198 0 return pack('l>/a', $_[0]);
199 }
200  
201 # TYPE: stringlist
202 0 ▶sub pack_stringlist {
Subroutine pack_stringlist: not called CC=1 SCAR=6.9
Pod undocumented
203 0 pack_short(0+@{$_[0]}).join('', map { pack_string($_) } @{$_[0]})
204 }
205  
206 0 ▶sub unpack_stringlist {
Subroutine unpack_stringlist: not called CC=1 SCAR=6.9
Pod undocumented
207 0 my $count= &unpack_short;
208 0 [ map &unpack_string, 1..$count ]
209 }
210  
211 # TYPE: bytes
212 0 ▶sub pack_bytes {
Subroutine pack_bytes: not called CC=3 SCAR=24.8
Pod undocumented
213 0 ▶ if (utf8::is_utf8($_[0])) {
Branch: 1 branch
BranchTrueFalseTotal
if (utf8::is_utf8($_[0])) 0 0 0
214 0 warn 'BUG: utf8 data passed to pack_bytes';
215 0 Encode::_utf8_off($_[0]);
216 }
217 0 ▶ defined $_[0] ? (pack_int(length($_[0])).$_[0]) : pack_int(-1)
Branch: 1 branch
BranchTrueFalseTotal
defined $_[0] ? : 0 0 0
218 }
219  
220 0 ▶sub unpack_bytes {
Subroutine unpack_bytes: not called CC=3 SCAR=24.8
Pod undocumented
221 0 my $len= &unpack_int;
222 0 ▶ if ($len > 0) {
Branch: 2 branches
BranchTrueFalseTotal
if ($len > 0) { } 0 0 0
elsif ($len < 0) { } 0 0 0
223 0 return substr($_[0], 0, $len, '');
224  
225 } elsif ($len < 0) {
226 0 return undef;
227  
228 } else {
229 0 return '';
230 }
231 }
232  
233 # TYPE: shortbytes
234 0 ▶sub pack_shortbytes {
Subroutine pack_shortbytes: not called CC=3 SCAR=24.8
Pod undocumented
235 0 ▶ if (utf8::is_utf8($_[0])) {
Branch: 1 branch
BranchTrueFalseTotal
if (utf8::is_utf8($_[0])) 0 0 0
236 0 warn 'BUG: utf8 data passed to pack_shortbytes';
237 0 Encode::_utf8_off($_[0]);
238 }
239 0 ▶ defined $_[0] ? (pack_short(length($_[0])).$_[0]) : pack_short(-1)
Branch: 1 branch
BranchTrueFalseTotal
defined $_[0] ? : 0 0 0
240 }
241  
242 0 ▶sub unpack_shortbytes {
Subroutine unpack_shortbytes: not called CC=3 SCAR=24.8
Pod undocumented
243 0 my $len= &unpack_short;
244 0 ▶ if ($len > 0) {
Branch: 2 branches
BranchTrueFalseTotal
if ($len > 0) { } 0 0 0
elsif ($len < 0) { } 0 0 0
245 0 return substr($_[0], 0, $len, '');
246  
247 } elsif ($len < 0) {
248 0 return undef;
249  
250 } else {
251 0 return '';
252 }
253 }
254  
255 # TYPE: inet
256 0 ▶sub unpack_inet {
Subroutine unpack_inet: not called CC=2 SCAR=17.9
Pod undocumented
257 0 my $length= unpack('C', substr($_[0], 0, 1, ''));
258 0 my $tmp_val= substr($_[0], 0, $length, '');
259  
260 0 my $addr;
261 0 ▶ if ($length == 4) {
Branch: 1 branch
BranchTrueFalseTotal
if ($length == 4) { } 0 0 0
262 0 $addr= join('.', unpack('CCCC', $tmp_val));
263 } else {
264 0 $addr= join(':', unpack('(H4)[8]', $tmp_val));
265 # Simplify the V6 address
266 0 $addr =~ s/\b0+(\d+)\b/$1/g;
267 0 $addr =~ s/\b0(:0)+\b/:/;
268 0 $addr =~ s/:::/::/;
269 }
270 0 return $addr;
271 }
272  
273 # TYPE: option_type
274 350 ▶sub pack_option_type {
Subroutine pack_option_type: called CC=10 SCAR=23.0
Pod undocumented
275 350 my ($type)= @_;
276 350 my ($id, @value)= @$type;
277 350 ▶ if ($id == TYPE_CUSTOM) {
Branch: 6 branches
BranchTrueFalseTotal
if ($id == 0) { } 4 346 350
elsif ($id < 32) { } 319 27 346
elsif ($id == 32 or $id == 34) { } 13 14 27
elsif ($id == 33) { } 9 5 14
elsif ($id == 48) { } 2 3 5
elsif ($id == 49) { } 3 0 3
278 4 return pack_short($id).pack_string($value[0]);
279 } elsif ($id < 0x20) {
280 319 return pack_short($id);
281 ▶ } elsif ($id == TYPE_LIST || $id == TYPE_SET) {
Condition100%3/3
$id == 32 or $id == 34
l!l&&r!l&&!r
9414
MC/DC100%2/2
$id == 32 or $id == 34
$id == 32 $id == 34
Truth table100%3/3
A or B
A= $id == 32B= $id == 34
ABresult
1X1
011
000
282 13 return pack_short($id).pack_option_type($value[0]);
283 } elsif ($id == TYPE_MAP) {
284 9 return pack_short($id).pack_option_type($value[0]).pack_option_type($value[1]);
285 } elsif ($id == TYPE_UDT) {
286 2 my $out= pack_short($id).pack_string($value[0]).pack_string($value[1]);
287 2 my @fields= @{$value[2]};
288 2 $out .= pack_short(0+@fields);
289 2 for my $field (@fields) {
290 2 $out .= pack_string($field->[0]).pack_option_type($field->[1]);
291 }
292 2 return $out;
293 } elsif ($id == TYPE_TUPLE) {
294 3 my @fields= @{$value[0]};
295 3 my $out= pack_short($id).pack_short(0+@fields);
296 3 $out .= pack_option_type($_) for @fields;
297 3 return $out;
298 } else {
299 0 die 'Unable to pack_option_type for type '.$id;
300 }
301 }
302  
303 # TYPE: stringmap
304 0 ▶sub pack_stringmap {
Subroutine pack_stringmap: not called CC=2 SCAR=17.9
Pod undocumented
305 0 my $pairs= '';
306 0 my $count= 0;
307 0 for my $key (sort keys %{$_[0]}) {
308 0 $pairs .= pack_string($key).pack_string($_[0]{$key});
309 0 $count++;
310 }
311 0 return pack_short($count).$pairs;
312 }
313  
314 # TYPE: stringmultimap
315 0 ▶sub pack_stringmultimap {
Subroutine pack_stringmultimap: not called CC=2 SCAR=17.9
Pod undocumented
316 0 my $pairs= '';
317 0 my $count= 0;
318 0 for my $key (sort keys %{$_[0]}) {
319 0 $pairs .= pack_string($key).pack_stringlist($_[0]{$key});
320 0 $count++;
321 }
322 0 return pack_short($count).$pairs;
323 }
324  
325 0 ▶sub unpack_stringmultimap {
Subroutine unpack_stringmultimap: not called CC=2 SCAR=17.9
Pod undocumented
326 0 my $count= &unpack_short;
327 0 my $result= {};
328 0 for (1..$count) {
329 0 my $key= &unpack_string;
330 0 $result->{$key}= &unpack_stringlist;
331 }
332 0 return $result;
333 }
334  
335 # Metadata
336 96 ▶sub pack_metadata {
Subroutine pack_metadata: called CC=9 SCAR=23.9
Pod undocumented
337 96 my ($protoversion, $is_result, $metadata)= @_;
338 96 ▶ die "pack_metadata can only encode v4 results" unless $protoversion == 4 and $is_result;
Branch: 1 branch
BranchTrueFalseTotal
unless $protoversion == 4 and $is_result 0 96 96
Condition33%1/3
$protoversion == 4 and $is_result
!ll&&!rl&&r
0096
MC/DC0%0/2
$protoversion == 4 and $is_result
$protoversion == 4 $is_result
Truth table33%1/3
A and B
A= $protoversion == 4B= $is_result
ABresult
0X0
100
111
339 96 my $columns= $metadata->{columns};
340 96 my $paging_state= $metadata->{paging_state};
341  
342 96 ▶ my $flags= ($columns ? 0 : 4) | (defined($paging_state) ? 2 : 0);
Branch: 2 branches
BranchTrueFalseTotal
$columns ? : 96 0 96
defined $paging_state ? : 0 96 96
343  
344 96 my $out= pack_int($flags);
345 96 ▶ $out .= pack_int($columns ? (0+@$columns) : 0);
Branch: 1 branch
BranchTrueFalseTotal
$columns ? : 96 0 96
346 96 ▶ $out .= pack_bytes($paging_state) if $flags & 2;
Branch: 1 branch
BranchTrueFalseTotal
if $flags & 2 0 96 96
347 96 ▶ unless ($flags & 4) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($flags & 4) 96 0 96
348 96 for my $column (@$columns) {
349 311 $out .= pack_string($column->[0]).pack_string($column->[1]);
350 311 $out .= pack_string($column->[2]).pack_option_type($column->[3]);
351 }
352 }
353  
354 96 return $out;
355 }
356  
357 # Query parameters
358 0 ▶sub pack_queryparameters {
Subroutine pack_queryparameters: not called CC=16 SCAR=56.1
Pod undocumented
359 0 my ($consistency, $skip_metadata, $page_size, $paging_state, $timestamp, $row)= @_;
360  
361 0 ▶ my $has_row= defined($row) && length($row);
Condition0%0/3
defined $row && length $row
!ll&&!rl&&r
000
MC/DC0%0/2
defined $row && length $row
defined $row length $row
Truth table0%0/3
A && B
A= defined $rowB= length $row
ABresult
0X0
100
111
362 0 ▶ my $flags= (
Condition0%0/20
$has_row && 1 || 0
l!l
00
$has_row and 1
!ll
00
$skip_metadata && 2 || 0
l!l
00
$skip_metadata and 2
!ll
00
$page_size && 4 || 0
l!l
00
$page_size and 4
!ll
00
$paging_state && 8 || 0
l!l
00
$paging_state and 8
!ll
00
$timestamp && 32 || 0
l!l
00
$timestamp and 32
!ll
00
MC/DC0%0/1
$has_row && 1 || 0
$has_row
MC/DC0%0/1
$skip_metadata && 2 || 0
$skip_metadata
MC/DC0%0/1
$page_size && 4 || 0
$page_size
MC/DC0%0/1
$paging_state && 8 || 0
$paging_state
MC/DC0%0/1
$timestamp && 32 || 0
$timestamp
Truth table0%0/2
A
A= $has_row
Aresult
11
00
Truth table0%0/2
A
A= $skip_metadata
Aresult
11
00
Truth table0%0/2
A
A= $page_size
Aresult
11
00
Truth table0%0/2
A
A= $paging_state
Aresult
11
00
Truth table0%0/2
A
A= $timestamp
Aresult
11
00
363 0
364 | (($has_row && 0x01) || 0)
365 | (($skip_metadata && 0x02) || 0)
366 | (($page_size && 0x04) || 0)
367 | (($paging_state && 0x08) || 0)
368 | (($timestamp && 0x20) || 0)
369 );
370  
371 return (
372 0 ▶ pack('nC', $consistency, $flags)
Branch: 3 branches
BranchTrueFalseTotal
$page_size ? : 0 0 0
$paging_state ? : 0 0 0
$timestamp ? : 0 0 0
Condition0%0/2
$row || ''
l!l
00
MC/DC0%0/1
$row || ''
$row
Truth table0%0/2
A
A= $row
Aresult
11
00
373 . ($row || '')
374 . ($page_size ? pack('l>', $page_size) : '')
375 . ($paging_state ? pack('l>/a', $paging_state) : '')
376 . ($timestamp ? (BIGINT_SUPPORTED ? pack('q>', $timestamp) : bigint_to_bytes($timestamp)) : '')
377 );
378 }
379  
380 0 ▶sub unpack_errordata {
Subroutine unpack_errordata: not called CC=6 SCAR=37.4
Pod undocumented
381 0 my $code= &unpack_int;
382  
383 0 my %error;
384 0 $error{code}= $code;
385 0 $error{message}= &unpack_string;
386 0 ▶ $error{is_timeout}= ( $code == 0x1001 || $code == 0x1100 || $code == 0x1200 );
Condition0%0/6
$code == 4097 || $code == 4352 || $code == 4608
l!l&&r!l&&!r
000
$code == 4097 or $code == 4352
l!l&&r!l&&!r
000
MC/DC0%0/3
$code == 4097 || $code == 4352 || $code == 4608
$code == 4097 $code == 4352 $code == 4608
Truth table0%0/4
A or B || C
A= $code == 4097B= $code == 4352C= $code == 4608
ABCresult
1XX1
01X1
0011
0000
387  
388 0 ▶ if ($code == 0x1000) {
Branch: 3 branches
BranchTrueFalseTotal
if ($code == 4096) { } 0 0 0
elsif ($code == 4352) { } 0 0 0
elsif ($code == 4608) { } 0 0 0
389 # Unavailable
390 0 $error{cl}= &unpack_short;
391 0 $error{required}= &unpack_int;
392 0 $error{alive}= &unpack_int;
393 0 return Cassandra::Client::Error::UnavailableException->new(%error);
394 } elsif ($code == 0x1100) {
395 # Write timeout
396 0 $error{cl}= &unpack_short;
397 0 $error{received}= &unpack_int;
398 0 $error{blockfor}= &unpack_int;
399 0 $error{write_type}= &unpack_string;
400 0 return Cassandra::Client::Error::WriteTimeoutException->new(%error);
401 } elsif ($code == 0x1200) {
402 # Read timeout
403 0 $error{cl}= &unpack_short;
404 0 $error{received}= &unpack_int;
405 0 $error{blockfor}= &unpack_int;
406 0 $error{data_present}= &unpack_char;
407 0 return Cassandra::Client::Error::ReadTimeoutException->new(%error);
408 }
409  
410 0 return Cassandra::Client::Error::Base->new(%error);
411 }
412  
413 # Support for 32bit perl
414 0 ▶sub bigint_to_bytes {
Subroutine bigint_to_bytes: not called CC=5 SCAR=34.0
Pod undocumented
415 0 my $mb= Math::BigInt->new($_[0]);
416 0 ▶ if ($_[0] !~ /^-?[0-9\.E]+$/i) { # Idk, approximate it
Branch: 1 branch
BranchTrueFalseTotal
unless ($_[0] =~ /^-?[0-9\.E]+$/i) 0 0 0
417 0 warn "Argument $_[0] isn't numeric";
418 }
419 0 ▶ my $negative= $mb->is_neg && $mb != 0;
Condition0%0/3
$mb->is_neg && $mb != 0
!ll&&!rl&&r
000
MC/DC0%0/2
$mb->is_neg && $mb != 0
$mb->is_neg $mb != 0
Truth table0%0/3
A && B
A= $mb->is_negB= $mb != 0
ABresult
0X0
100
111
420 0 ▶ if ($negative) {
Branch: 1 branch
BranchTrueFalseTotal
if ($negative) 0 0 0
421 0 $mb *= -1; # Flips the bits, adds one
422 0 $mb -= 1; # Removes that one
423 }
424  
425 0 my $hex= $mb->as_hex;
426 0 $hex =~ s/^0x//;
427 0 my $bytes= pack('H*', substr(("0"x16).$hex, -16));
428 0 ▶ if ($negative) {
Branch: 1 branch
BranchTrueFalseTotal
if ($negative) 0 0 0
429 0 $bytes= ~$bytes; # Flip those bits back
430 }
431  
432 0 return $bytes;
433 }
434  
435 13 1;
436  
437 __END__
« blib/lib/Cassandra/Client/Connection.pm ↑ Summary blib/lib/Cassandra/Client/Pool.pm »