Elasticsearch/CxnPool/Static/NoPing.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 15 / 15 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Elasticsearch/Cxn/Factory.pm ↑ Summary Elasticsearch/Role/Is_Sync.pm »
1 package Search::Elasticsearch::CxnPool::Static::NoPing;
2 7 $Search::Elasticsearch::CxnPool::Static::NoPing::VERSION = '6.80';
3 7 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 with 'Search::Elasticsearch::Role::CxnPool::Static::NoPing',
5 'Search::Elasticsearch::Role::Is_Sync';
6 7 ▶use Search::Elasticsearch::Util qw(throw);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 7 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 7 1;
10  
11 =pod
12  
13 =encoding UTF-8
14  
15 =head1 NAME
16  
17 Search::Elasticsearch::CxnPool::Static::NoPing - A CxnPool for connecting to a remote cluster without the ability to ping.
18  
19 =head1 VERSION
20  
21 version 6.80
22  
23 =head1 SYNOPSIS
24  
25 $e = Search::Elasticsearch->new(
26 cxn_pool => 'Static::NoPing'
27 nodes => [
28 'search1:9200',
29 'search2:9200'
30 ],
31 );
32  
33 =head1 DESCRIPTION
34  
35 The L<Static::NoPing|Search::Elasticsearch::CxnPool::Static::NoPing> connection
36 pool (like the L<Static|Search::Elasticsearch::CxnPool::Static> pool) should be used
37 when your access to the cluster is limited. However, the C<Static> pool needs
38 to be able to ping nodes in the cluster, with a C<HEAD /> request. If you
39 can't ping your nodes, then you should use the C<Static::NoPing>
40 connection pool instead.
41  
42 Because the cluster cannot be pinged, this CxnPool cannot use a short
43 ping request to determine whether nodes are live or not - it just has to
44 send requests to the nodes to determine whether they are alive or not.
45  
46 Most of the time, a dead node will cause the request to fail quickly.
47 However, in situations where node failure takes time (eg malfunctioning
48 routers or firewalls), a failure may not be reported until the request
49 itself times out (see L<Search::Elasticsearch::Cxn/request_timeout>).
50  
51 Failed nodes will be retried regularly to check if they have recovered.
52  
53 This class does L<Search::Elasticsearch::Role::CxnPool::Static::NoPing> and
54 L<Search::Elasticsearch::Role::Is_Sync>.
55  
56 =head1 CONFIGURATION
57  
58 =head2 C<nodes>
59  
60 The list of nodes to use to serve requests. Can accept a single node,
61 multiple nodes, and defaults to C<localhost:9200> if no C<nodes> are
62 specified. See L<Search::Elasticsearch::Role::Cxn/node> for details of the node
63 specification.
64  
65 =head2 See also
66  
67 =over
68  
69 =item *
70  
71 L<Search::Elasticsearch::Role::Cxn/request_timeout>
72  
73 =item *
74  
75 L<Search::Elasticsearch::Role::Cxn/dead_timeout>
76  
77 =item *
78  
79 L<Search::Elasticsearch::Role::Cxn/max_dead_timeout>
80  
81 =back
82  
83 =head2 Inherited configuration
84  
85 From L<Search::Elasticsearch::Role::CxnPool::Static::NoPing>
86  
87 =over
88  
89 =item * L<max_retries|Search::Elasticsearch::Role::CxnPool::Static::NoPing/"max_retries">
90  
91 =back
92  
93 From L<Search::Elasticsearch::Role::CxnPool>
94  
95 =over
96  
97 =item * L<randomize_cxns|Search::Elasticsearch::Role::CxnPool/"randomize_cxns">
98  
99 =back
100  
101 =head1 METHODS
102  
103 =head2 C<next_cxn()>
104  
105 $cxn = $cxn_pool->next_cxn
106  
107 Returns the next available node in round robin fashion - either a live node
108 which has previously responded successfully, or a previously failed
109 node which should be retried. If all nodes are dead, it will throw
110 a C<NoNodes> error.
111  
112 =head2 Inherited methods
113  
114 From L<Search::Elasticsearch::Role::CxnPool::Static::NoPing>
115  
116 =over
117  
118 =item * L<should_mark_dead()|Search::Elasticsearch::Role::CxnPool::Static::NoPing/"should_mark_dead()">
119  
120 =item * L<schedule_check()|Search::Elasticsearch::Role::CxnPool::Static::NoPing/"schedule_check()">
121  
122 =back
123  
124 From L<Search::Elasticsearch::Role::CxnPool>
125  
126 =over
127  
128 =item * L<cxn_factory()|Search::Elasticsearch::Role::CxnPool/"cxn_factory()">
129  
130 =item * L<logger()|Search::Elasticsearch::Role::CxnPool/"logger()">
131  
132 =item * L<serializer()|Search::Elasticsearch::Role::CxnPool/"serializer()">
133  
134 =item * L<current_cxn_num()|Search::Elasticsearch::Role::CxnPool/"current_cxn_num()">
135  
136 =item * L<cxns()|Search::Elasticsearch::Role::CxnPool/"cxns()">
137  
138 =item * L<seed_nodes()|Search::Elasticsearch::Role::CxnPool/"seed_nodes()">
139  
140 =item * L<next_cxn_num()|Search::Elasticsearch::Role::CxnPool/"next_cxn_num()">
141  
142 =item * L<set_cxns()|Search::Elasticsearch::Role::CxnPool/"set_cxns()">
143  
144 =item * L<request_ok()|Search::Elasticsearch::Role::CxnPool/"request_ok()">
145  
146 =item * L<request_failed()|Search::Elasticsearch::Role::CxnPool/"request_failed()">
147  
148 =item * L<should_retry()|Search::Elasticsearch::Role::CxnPool/"should_retry()">
149  
150 =item * L<should_mark_dead()|Search::Elasticsearch::Role::CxnPool/"should_mark_dead()">
151  
152 =item * L<cxns_str()|Search::Elasticsearch::Role::CxnPool/"cxns_str()">
153  
154 =item * L<cxns_seeds_str()|Search::Elasticsearch::Role::CxnPool/"cxns_seeds_str()">
155  
156 =item * L<retries()|Search::Elasticsearch::Role::CxnPool/"retries()">
157  
158 =item * L<reset_retries()|Search::Elasticsearch::Role::CxnPool/"reset_retries()">
159  
160 =back
161  
162 =head1 AUTHOR
163  
164 Enrico Zimuel <enrico.zimuel@elastic.co>
165  
166 =head1 COPYRIGHT AND LICENSE
167  
168 This software is Copyright (c) 2020 by Elasticsearch BV.
169  
170 This is free software, licensed under:
171  
172 The Apache License, Version 2.0, January 2004
173  
174 =cut
175  
176 __END__
« Elasticsearch/Cxn/Factory.pm ↑ Summary Elasticsearch/Role/Is_Sync.pm »