1Search::Elasticsearch::URsoelre:C:oCnxtnrPioboult(e3d)PSeeralrcDho:c:uEmleansttaitcisoenarch::Role::CxnPool(3)
2
3
4
6 Search::Elasticsearch::Role::CxnPool - Provides common functionality to
7 the CxnPool implementations
8
10 version 6.00
11
13 See the CxnPool implementations:
14
15 · Search::Elasticsearch::CxnPool::Static
16
17 · Search::Elasticsearch::CxnPool::Sniff
18
19 · Search::Elasticsearch::CxnPool::Static::NoPing
20
22 These configuration options should not be set by the user but are
23 documented here for completeness.
24
25 "randomize_cxns"
26 By default, the order of cxns passed to "set_cxns()" is randomized
27 before they are stored. Set "randomize_cxns" to a false value to
28 disable.
29
31 "cxn_factory()"
32 $factory = $cxn_pool->cxn_factory
33
34 Returns the Search::Elasticsearch::Cxn::Factory object for creating a
35 new $cxn instance.
36
37 "logger()"
38 $logger = $cxn_pool->logger
39
40 Returns the Search::Elasticsearch::Role::Logger-based object, which
41 defaults to Search::Elasticsearch::Logger::LogAny.
42
43 "serializer()"
44 $serializer = $cxn_pool->serializer
45
46 Returns the Search::Elasticsearch::Role::Serializer-based object, which
47 defaults to Search::Elasticsearch::Serializer::JSON.
48
49 "current_cxn_num()"
50 $num = $cxn_pool->current_cxn_num
51
52 Returns the current cxn number, which is an offset into the array of
53 cxns set by "set_cxns()".
54
55 "cxns()"
56 \@cxns = $cxn_pool->cxns;
57
58 Returns the current list of Search::Elasticsearch::Role::Cxn-based cxn
59 objects as set by "set_cxns()".
60
61 "seed_nodes()"
62 \@seed_nodes = $cxn_pool->seed_nodes
63
64 Returns the list of "nodes" originally specified when calling "new()"
65 in Search::Elasticsearch.
66
67 "next_cxn_num()"
68 $num = $cxn_pool->next_cxn_num;
69
70 Returns the number of the next connection, in round-robin fashion.
71 Updates the "current_cxn_num()".
72
73 "set_cxns()"
74 $cxn_pool->set_cxns(@nodes);
75
76 Takes a list of nodes, converts them into
77 Search::Elasticsearch::Role::Cxn-based objects and makes them
78 accessible via "cxns()".
79
80 "request_ok()"
81 $cxn_pool->request_ok($cxn);
82
83 Called when a request by the specified $cxn object has completed
84 successfully. Marks the $cxn as live.
85
86 "request_failed()"
87 $should_retry = $cxn_pool->request_failed($cxn,$error);
88
89 Called when a request by the specified $cxn object has failed. Returns
90 1 if the request should be retried or 0 if it shouldn't.
91
92 "should_retry()"
93 $bool = $cxn_pool->should_retry($error);
94
95 Examines the error to decide whether the request should be retried or
96 not. By default, only "Search::Elasticsearch::Error::Cxn" in
97 Search::Elasticsearch::Error errors are retried.
98
99 "should_mark_dead()"
100 $bool = $cxn_pool->should_mark_dead($error);
101
102 Examines the error to decide whether the $cxn should be marked as dead
103 or not. By default, only "Search::Elasticsearch::Error::Cxn" in
104 Search::Elasticsearch::Error errors cause a $cxn to be marked as dead.
105
106 "cxns_str()"
107 $str = $cxn_pool->cxns_str
108
109 Returns all "cxns()" as a string for logging purposes.
110
111 "cxns_seeds_str()"
112 $str = $cxn_pool->cxns_seeeds_str
113
114 Returns all "cxns()" and "seed_nodes()" as a string for logging
115 purposes.
116
117 "retries()"
118 $retries = $cxn_pool->retries
119
120 The number of times the current request has been retried.
121
122 "reset_retries()"
123 $cxn_pool->reset_retries;
124
125 Called at the start of a new request to reset the retries count.
126
128 Clinton Gormley <drtech@cpan.org>
129
131 This software is Copyright (c) 2017 by Elasticsearch BV.
132
133 This is free software, licensed under:
134
135 The Apache License, Version 2.0, January 2004
136
137
138
139perl v5.30.1 2020-0S1e-a3r0ch::Elasticsearch::Role::CxnPool(3)