« blib/lib/Cassandra/Client/Policy/Queue/Default.pm
↑ Summary
blib/lib/Cassandra/Client/Policy/Auth/Password.pm »
| 1 | package Cassandra::Client::Metadata; | ||||||||||
| 2 | 13 | our $AUTHORITY = 'cpan:TVDW'; | |||||||||
| 3 | 13 | $Cassandra::Client::Metadata::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 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 9 | 0 | my ($class, %args)= @_; | |||||||||
| 10 | |||||||||||
| 11 | 0 | return bless { | |||||||||
| 12 | prepare_cache => {}, | ||||||||||
| 13 | }, $class; | ||||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | sub prepare_cache { | ||||||||
|
Subroutine
prepare_cache: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 17 | 0 | return $_[0]{prepare_cache}; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | sub add_prepared { | ||||||||
|
Subroutine
add_prepared: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 21 | 0 | my ($self, $query, $id, $decoder, $encoder)= @_; | |||||||||
| 22 | 0 | $self->{prepare_cache}{$query}= { | |||||||||
| 23 | id => $id, | ||||||||||
| 24 | decoder => $decoder, | ||||||||||
| 25 | encoder => $encoder | ||||||||||
| 26 | }; | ||||||||||
| 27 | 0 | ▶ | if (values %{$self->{prepare_cache}} > 500) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | ▶ | unless ($self->{warned}++) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | warn "Cassandra::Client: found more than 500 queries in our prepared statement cache, try using placeholders"; | |||||||||
| 30 | } | ||||||||||
| 31 | } | ||||||||||
| 32 | 0 | return; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | sub is_prepared { | ||||||||
|
Subroutine
is_prepared: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 36 | 0 | my ($self, $queryref)= @_; | |||||||||
| 37 | 0 | my $cached= $self->{prepare_cache}{$$queryref}; | |||||||||
| 38 | 0 | ▶ | if (!$cached) { return; } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | |||||||||||
| 40 | 0 | return 1; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 13 | 1; | |||||||||
| 44 | |||||||||||
| 45 | __END__ | ||||||||||