line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Memcached::Client::Compressor; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
623
|
$Memcached::Client::Compressor::VERSION = '2.01'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
#ABSTRACT: Abstract Base Class For Memcached::Client Compressor |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
65
|
|
8
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
66
|
|
9
|
2
|
|
|
2
|
|
498
|
use Memcached::Client::Log qw{LOG}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
677
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
2
|
|
|
2
|
1
|
59
|
my $class = shift; |
14
|
2
|
|
|
|
|
11
|
my $self = bless {compress_threshold => 0}, $class; |
15
|
2
|
|
|
|
|
19
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub compress_threshold { |
20
|
3
|
|
|
3
|
1
|
9
|
my ($self, $new) = @_; |
21
|
3
|
|
|
|
|
9
|
my $ret = $self->{compress_threshold}; |
22
|
3
|
100
|
|
|
|
17
|
$self->{compress_threshold} = $new if ($new); |
23
|
3
|
|
|
|
|
18
|
return $ret; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub decompress { |
28
|
1
|
|
|
1
|
1
|
6
|
die "You must implement decompress"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub compress { |
33
|
1
|
|
|
1
|
1
|
13
|
die "You must implement compress"; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub log { |
38
|
0
|
|
|
0
|
1
|
|
my ($self, $format, @args) = @_; |
39
|
0
|
|
0
|
|
|
|
my $prefix = ref $self || $self; |
40
|
0
|
|
|
|
|
|
$prefix =~ s,Memcached::Client::Compressor::,Compressor/,; |
41
|
0
|
|
|
|
|
|
LOG ("$prefix> " . $format, @args); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |