line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cassandra::Client::Metadata; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TVDW'; |
3
|
|
|
|
|
|
|
$Cassandra::Client::Metadata::VERSION = '0.13_007'; # TRIAL |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
15
|
$Cassandra::Client::Metadata::VERSION = '0.13007';use 5.010; |
|
1
|
|
|
|
|
3
|
|
6
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
7
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
169
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
0
|
|
|
0
|
0
|
|
my ($class, %args)= @_; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
return bless { |
13
|
|
|
|
|
|
|
prepare_cache => {}, |
14
|
|
|
|
|
|
|
}, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub prepare_cache { |
18
|
0
|
|
|
0
|
0
|
|
return $_[0]{prepare_cache}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub add_prepared { |
22
|
0
|
|
|
0
|
0
|
|
my ($self, $query, $id, $decoder, $encoder)= @_; |
23
|
0
|
|
|
|
|
|
$self->{prepare_cache}{$query}= { |
24
|
|
|
|
|
|
|
id => $id, |
25
|
|
|
|
|
|
|
decoder => $decoder, |
26
|
|
|
|
|
|
|
encoder => $encoder |
27
|
|
|
|
|
|
|
}; |
28
|
0
|
0
|
|
|
|
|
if (values %{$self->{prepare_cache}} > 500) { |
|
0
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
unless ($self->{warned}++) { |
30
|
0
|
|
|
|
|
|
warn "Cassandra::Client: found more than 500 queries in our prepared statement cache, try using placeholders"; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
0
|
|
|
|
|
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub is_prepared { |
37
|
0
|
|
|
0
|
0
|
|
my ($self, $queryref)= @_; |
38
|
0
|
|
|
|
|
|
my $cached= $self->{prepare_cache}{$$queryref}; |
39
|
0
|
0
|
|
|
|
|
if (!$cached) { return; } |
|
0
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return 1; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |