line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DWH_File::Cache; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
49
|
use warnings; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
273
|
|
4
|
9
|
|
|
9
|
|
43
|
use strict; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
569
|
|
5
|
9
|
|
|
9
|
|
46
|
use vars qw( @ISA $VERSION ); |
|
9
|
|
|
|
|
13
|
|
|
9
|
|
|
|
|
3869
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
@ISA = qw( ); |
8
|
|
|
|
|
|
|
$VERSION = 0.1; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
13
|
|
|
13
|
0
|
47
|
my ( $this ) = @_; |
12
|
13
|
|
33
|
|
|
256
|
my $class = ref $this || $this; |
13
|
13
|
|
|
|
|
33
|
my $self = {}; |
14
|
13
|
|
|
|
|
40
|
bless $self, $class; |
15
|
13
|
|
|
|
|
190
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub encache { |
19
|
|
|
|
|
|
|
# weaken if available |
20
|
61
|
|
|
61
|
0
|
492
|
$_[ 0 ]->{ $_[ 1 ]->cache_key } = $_[ 1 ]; |
21
|
61
|
|
|
|
|
578
|
$_[ 1 ]->cache_up; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub decache { |
25
|
13
|
|
|
13
|
0
|
5458
|
delete $_[ 0 ]->{ $_[ 1 ]->cache_key }; |
26
|
13
|
|
|
|
|
195
|
$_[ 1 ]->cache_down; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub retrieve { |
30
|
305
|
100
|
|
305
|
0
|
1008
|
if ( exists $_[ 0 ]->{ $_[ 1 ] } ) { return $_[ 0 ]->{ $_[ 1 ] } } |
|
272
|
|
|
|
|
1393
|
|
31
|
33
|
|
|
|
|
176
|
else { return undef } |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |