line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Licensed to Elasticsearch B.V. under one or more contributor |
2
|
|
|
|
|
|
|
# license agreements. See the NOTICE file distributed with |
3
|
|
|
|
|
|
|
# this work for additional information regarding copyright |
4
|
|
|
|
|
|
|
# ownership. Elasticsearch B.V. licenses this file to you under |
5
|
|
|
|
|
|
|
# the Apache License, Version 2.0 (the "License"); you may |
6
|
|
|
|
|
|
|
# not use this file except in compliance with the License. |
7
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, |
12
|
|
|
|
|
|
|
# software distributed under the License is distributed on an |
13
|
|
|
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14
|
|
|
|
|
|
|
# KIND, either express or implied. See the License for the |
15
|
|
|
|
|
|
|
# specific language governing permissions and limitations |
16
|
|
|
|
|
|
|
# under the License. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package Search::Elasticsearch::CxnPool::Static::NoPing; |
19
|
|
|
|
|
|
|
$Search::Elasticsearch::CxnPool::Static::NoPing::VERSION = '8.00'; |
20
|
7
|
|
|
7
|
|
3110
|
use Moo; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
35
|
|
21
|
|
|
|
|
|
|
with 'Search::Elasticsearch::Role::CxnPool::Static::NoPing', |
22
|
|
|
|
|
|
|
'Search::Elasticsearch::Role::Is_Sync'; |
23
|
7
|
|
|
7
|
|
2058
|
use Search::Elasticsearch::Util qw(throw); |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
35
|
|
24
|
7
|
|
|
7
|
|
1642
|
use namespace::clean; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
36
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=pod |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=encoding UTF-8 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Search::Elasticsearch::CxnPool::Static::NoPing - A CxnPool for connecting to a remote cluster without the ability to ping. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 VERSION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
version 8.00 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
$e = Search::Elasticsearch->new( |
43
|
|
|
|
|
|
|
cxn_pool => 'Static::NoPing' |
44
|
|
|
|
|
|
|
nodes => [ |
45
|
|
|
|
|
|
|
'search1:9200', |
46
|
|
|
|
|
|
|
'search2:9200' |
47
|
|
|
|
|
|
|
], |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
The L connection |
53
|
|
|
|
|
|
|
pool (like the L pool) should be used |
54
|
|
|
|
|
|
|
when your access to the cluster is limited. However, the C pool needs |
55
|
|
|
|
|
|
|
to be able to ping nodes in the cluster, with a C | request. If you
56
|
|
|
|
|
|
|
can't ping your nodes, then you should use the C |
57
|
|
|
|
|
|
|
connection pool instead. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Because the cluster cannot be pinged, this CxnPool cannot use a short |
60
|
|
|
|
|
|
|
ping request to determine whether nodes are live or not - it just has to |
61
|
|
|
|
|
|
|
send requests to the nodes to determine whether they are alive or not. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Most of the time, a dead node will cause the request to fail quickly. |
64
|
|
|
|
|
|
|
However, in situations where node failure takes time (eg malfunctioning |
65
|
|
|
|
|
|
|
routers or firewalls), a failure may not be reported until the request |
66
|
|
|
|
|
|
|
itself times out (see L). |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Failed nodes will be retried regularly to check if they have recovered. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This class does L and |
71
|
|
|
|
|
|
|
L. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 CONFIGURATION |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 C |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
The list of nodes to use to serve requests. Can accept a single node, |
78
|
|
|
|
|
|
|
multiple nodes, and defaults to C if no C are |
79
|
|
|
|
|
|
|
specified. See L for details of the node |
80
|
|
|
|
|
|
|
specification. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 See also |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=over |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=item * |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
L |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
L |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=back |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head2 Inherited configuration |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
From L |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=over |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * L |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=back |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
From L |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=over |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item * L |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=back |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 METHODS |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head2 C |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
$cxn = $cxn_pool->next_cxn |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Returns the next available node in round robin fashion - either a live node |
125
|
|
|
|
|
|
|
which has previously responded successfully, or a previously failed |
126
|
|
|
|
|
|
|
node which should be retried. If all nodes are dead, it will throw |
127
|
|
|
|
|
|
|
a C error. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head2 Inherited methods |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
From L |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=over |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item * L |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item * L |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=back |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
From L |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=over |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item * L |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item * L |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item * L |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * L |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item * L |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=item * L |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item * L |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item * L |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item * L |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item * L |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=item * L |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=item * L |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=item * L |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=item * L |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=item * L |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item * L |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=back |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head1 AUTHOR |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
Enrico Zimuel |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
This software is Copyright (c) 2022 by Elasticsearch BV. |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
This is free software, licensed under: |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
The Apache License, Version 2.0, January 2004 |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=cut |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
__END__ |