line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package DataCube::Connection; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1461
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
7
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
8
|
1
|
|
|
1
|
|
34
|
use DataCube::FileUtils; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use DataCube::Connection::Table; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
|
|
|
|
|
|
my($class,$source) = @_; |
13
|
|
|
|
|
|
|
die "DataCube::Connection(new):\nplease provide a directory to the new constructor\n$!\n" |
14
|
|
|
|
|
|
|
unless -d($source); |
15
|
|
|
|
|
|
|
my $self = bless {}, ref($class) || $class; |
16
|
|
|
|
|
|
|
my $utils = DataCube::FileUtils->new; |
17
|
|
|
|
|
|
|
my @source = $utils->dir($source); |
18
|
|
|
|
|
|
|
for(@source){ |
19
|
|
|
|
|
|
|
my $path = "$source/$_"; |
20
|
|
|
|
|
|
|
next unless -d($path); |
21
|
|
|
|
|
|
|
$self->{tables}->{$path} = DataCube::Connection::Table->new($path); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub sync { |
27
|
|
|
|
|
|
|
my($self) = @_; |
28
|
|
|
|
|
|
|
for(keys %{$self->{tables}}){ |
29
|
|
|
|
|
|
|
my $dir = $_; |
30
|
|
|
|
|
|
|
$self->{tables}->{$dir}->sync($dir); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub source { |
36
|
|
|
|
|
|
|
my($self) = @_; |
37
|
|
|
|
|
|
|
return $self->{source}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub report { |
41
|
|
|
|
|
|
|
my($self,$dir) = @_; |
42
|
|
|
|
|
|
|
die "DataCube::Connection(report):\nplease provide a directory to save reports\n$!\n" |
43
|
|
|
|
|
|
|
unless -d($dir); |
44
|
|
|
|
|
|
|
for(keys %{$self->{tables}}){ |
45
|
|
|
|
|
|
|
$self->{tables}->{$_}->report($dir); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
return $self; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub report_html { |
51
|
|
|
|
|
|
|
my($self,$dir) = @_; |
52
|
|
|
|
|
|
|
die "DataCube::Connection(report):\nplease provide a directory to save reports\n$!\n" |
53
|
|
|
|
|
|
|
unless -d($dir); |
54
|
|
|
|
|
|
|
for(keys %{$self->{tables}}){ |
55
|
|
|
|
|
|
|
$self->{tables}->{$_}->report_html($dir); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
return $self; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|