line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Aurora; |
2
|
1
|
|
|
1
|
|
13491
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
65
|
|
5
|
1
|
|
|
1
|
|
317
|
use DBIx::Aurora::Cluster; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
178
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
7
|
|
|
|
|
|
|
our $AUTOLOAD; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
0
|
|
|
0
|
0
|
|
my ($class, %clusters) = @_; |
11
|
0
|
|
|
|
|
|
my $self = bless { clusters => {} }, $class; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
for my $cluster_name (keys %clusters) { |
14
|
0
|
|
|
|
|
|
my $config = $clusters{$cluster_name}; |
15
|
0
|
|
|
|
|
|
$self->{clusters}{lc $cluster_name} = DBIx::Aurora::Cluster->new(@$config{qw/ instances opts /}); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
return $self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub AUTOLOAD { |
22
|
0
|
|
|
0
|
|
|
my ($self, @args) = @_; |
23
|
0
|
|
|
|
|
|
my $method = [ split /::/, $AUTOLOAD ]->[-1]; |
24
|
|
|
|
|
|
|
$self->{clusters}{$method} |
25
|
|
|
|
|
|
|
or Carp::croak "Cannot find cluster `$method`. Available clusters are: " |
26
|
0
|
0
|
|
|
|
|
. join ", ", sort keys %{$self->{clusters}}; |
|
0
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
__END__ |