line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cassandra::Client::Policy::Retry::Default; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TVDW'; |
3
|
|
|
|
|
|
|
$Cassandra::Client::Policy::Retry::Default::VERSION = '0.13_006'; # TRIAL |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
13
|
$Cassandra::Client::Policy::Retry::Default::VERSION = '0.13006';use 5.010; |
|
1
|
|
|
|
|
2
|
|
6
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15
|
|
7
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
42
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
|
|
280
|
use Cassandra::Client::Policy::Retry qw/ |
10
|
|
|
|
|
|
|
try_next_host |
11
|
|
|
|
|
|
|
retry |
12
|
|
|
|
|
|
|
rethrow |
13
|
1
|
|
|
1
|
|
270
|
/; |
|
1
|
|
|
|
|
2
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
0
|
|
|
0
|
0
|
|
my ($class)= @_; |
17
|
0
|
|
|
|
|
|
return bless {}, $class; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub on_read_timeout { |
21
|
0
|
|
|
0
|
0
|
|
my ($self, $statement, $consistency_level, $required_responses, $received_responses, $data_retrieved, $nr_retries)= @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
|
return rethrow if $nr_retries; |
24
|
0
|
0
|
0
|
|
|
|
return retry if $received_responses >= $required_responses && !$data_retrieved; |
25
|
0
|
|
|
|
|
|
return rethrow; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub on_unavailable { |
29
|
0
|
|
|
0
|
0
|
|
my ($self, $statement, $consistency_level, $required_replicas, $alive_replicas, $nr_retries)= @_; |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
return rethrow if $nr_retries; |
32
|
0
|
|
|
|
|
|
return try_next_host; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub on_write_timeout { |
36
|
0
|
|
|
0
|
0
|
|
my ($self, $statement, $consistency_level, $write_type, $required_acks, $received_acks, $nr_retries)= @_; |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
return rethrow if $nr_retries; |
39
|
0
|
0
|
|
|
|
|
return retry if $write_type eq 'BATCH_LOG'; |
40
|
0
|
|
|
|
|
|
return rethrow; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub on_request_error { |
44
|
0
|
|
|
0
|
0
|
|
my ($self, $statement, $consistency_level, $error, $nr_retries)= @_; |
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
return rethrow if $nr_retries; |
47
|
0
|
|
|
|
|
|
return try_next_host; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |