.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Search::Elasticsearch::Role::CxnPool 3pm" .TH Search::Elasticsearch::Role::CxnPool 3pm "2018-05-17" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Search::Elasticsearch::Role::CxnPool \- Provides common functionality to the CxnPool implementations .SH "VERSION" .IX Header "VERSION" version 6.00 .SH "DESCRIPTION" .IX Header "DESCRIPTION" See the CxnPool implementations: .IP "\(bu" 4 Search::Elasticsearch::CxnPool::Static .IP "\(bu" 4 Search::Elasticsearch::CxnPool::Sniff .IP "\(bu" 4 Search::Elasticsearch::CxnPool::Static::NoPing .SH "CONFIGURATION" .IX Header "CONFIGURATION" These configuration options should not be set by the user but are documented here for completeness. .ie n .SS """randomize_cxns""" .el .SS "\f(CWrandomize_cxns\fP" .IX Subsection "randomize_cxns" By default, the order of cxns passed to \*(L"\fIset_cxns()\fR\*(R" is randomized before they are stored. Set \f(CW\*(C`randomize_cxns\*(C'\fR to a false value to disable. .SH "METHODS" .IX Header "METHODS" .ie n .SS """cxn_factory()""" .el .SS "\f(CWcxn_factory()\fP" .IX Subsection "cxn_factory()" .Vb 1 \& $factory = $cxn_pool\->cxn_factory .Ve .PP Returns the Search::Elasticsearch::Cxn::Factory object for creating a new \&\f(CW$cxn\fR instance. .ie n .SS """logger()""" .el .SS "\f(CWlogger()\fP" .IX Subsection "logger()" .Vb 1 \& $logger = $cxn_pool\->logger .Ve .PP Returns the Search::Elasticsearch::Role::Logger\-based object, which defaults to Search::Elasticsearch::Logger::LogAny. .ie n .SS """serializer()""" .el .SS "\f(CWserializer()\fP" .IX Subsection "serializer()" .Vb 1 \& $serializer = $cxn_pool\->serializer .Ve .PP Returns the Search::Elasticsearch::Role::Serializer\-based object, which defaults to Search::Elasticsearch::Serializer::JSON. .ie n .SS """current_cxn_num()""" .el .SS "\f(CWcurrent_cxn_num()\fP" .IX Subsection "current_cxn_num()" .Vb 1 \& $num = $cxn_pool\->current_cxn_num .Ve .PP Returns the current cxn number, which is an offset into the array of cxns set by \*(L"\fIset_cxns()\fR\*(R". .ie n .SS """cxns()""" .el .SS "\f(CWcxns()\fP" .IX Subsection "cxns()" .Vb 1 \& \e@cxns = $cxn_pool\->cxns; .Ve .PP Returns the current list of Search::Elasticsearch::Role::Cxn\-based cxn objects as set by \*(L"\fIset_cxns()\fR\*(R". .ie n .SS """seed_nodes()""" .el .SS "\f(CWseed_nodes()\fP" .IX Subsection "seed_nodes()" .Vb 1 \& \e@seed_nodes = $cxn_pool\->seed_nodes .Ve .PP Returns the list of \f(CW\*(C`nodes\*(C'\fR originally specified when calling \&\*(L"\fInew()\fR\*(R" in Search::Elasticsearch. .ie n .SS """next_cxn_num()""" .el .SS "\f(CWnext_cxn_num()\fP" .IX Subsection "next_cxn_num()" .Vb 1 \& $num = $cxn_pool\->next_cxn_num; .Ve .PP Returns the number of the next connection, in round-robin fashion. Updates the \*(L"\fIcurrent_cxn_num()\fR\*(R". .ie n .SS """set_cxns()""" .el .SS "\f(CWset_cxns()\fP" .IX Subsection "set_cxns()" .Vb 1 \& $cxn_pool\->set_cxns(@nodes); .Ve .PP Takes a list of nodes, converts them into Search::Elasticsearch::Role::Cxn\-based objects and makes them accessible via \*(L"\fIcxns()\fR\*(R". .ie n .SS """request_ok()""" .el .SS "\f(CWrequest_ok()\fP" .IX Subsection "request_ok()" .Vb 1 \& $cxn_pool\->request_ok($cxn); .Ve .PP Called when a request by the specified \f(CW$cxn\fR object has completed successfully. Marks the \f(CW$cxn\fR as live. .ie n .SS """request_failed()""" .el .SS "\f(CWrequest_failed()\fP" .IX Subsection "request_failed()" .Vb 1 \& $should_retry = $cxn_pool\->request_failed($cxn,$error); .Ve .PP Called when a request by the specified \f(CW$cxn\fR object has failed. Returns \&\f(CW1\fR if the request should be retried or \f(CW0\fR if it shouldn't. .ie n .SS """should_retry()""" .el .SS "\f(CWshould_retry()\fP" .IX Subsection "should_retry()" .Vb 1 \& $bool = $cxn_pool\->should_retry($error); .Ve .PP Examines the error to decide whether the request should be retried or not. By default, only \*(L"Search::Elasticsearch::Error::Cxn\*(R" in Search::Elasticsearch::Error errors are retried. .ie n .SS """should_mark_dead()""" .el .SS "\f(CWshould_mark_dead()\fP" .IX Subsection "should_mark_dead()" .Vb 1 \& $bool = $cxn_pool\->should_mark_dead($error); .Ve .PP Examines the error to decide whether the \f(CW$cxn\fR should be marked as dead or not. By default, only \*(L"Search::Elasticsearch::Error::Cxn\*(R" in Search::Elasticsearch::Error errors cause a \f(CW$cxn\fR to be marked as dead. .ie n .SS """cxns_str()""" .el .SS "\f(CWcxns_str()\fP" .IX Subsection "cxns_str()" .Vb 1 \& $str = $cxn_pool\->cxns_str .Ve .PP Returns all \*(L"\fIcxns()\fR\*(R" as a string for logging purposes. .ie n .SS """cxns_seeds_str()""" .el .SS "\f(CWcxns_seeds_str()\fP" .IX Subsection "cxns_seeds_str()" .Vb 1 \& $str = $cxn_pool\->cxns_seeeds_str .Ve .PP Returns all \*(L"\fIcxns()\fR\*(R" and \*(L"\fIseed_nodes()\fR\*(R" as a string for logging purposes. .ie n .SS """retries()""" .el .SS "\f(CWretries()\fP" .IX Subsection "retries()" .Vb 1 \& $retries = $cxn_pool\->retries .Ve .PP The number of times the current request has been retried. .ie n .SS """reset_retries()""" .el .SS "\f(CWreset_retries()\fP" .IX Subsection "reset_retries()" .Vb 1 \& $cxn_pool\->reset_retries; .Ve .PP Called at the start of a new request to reset the retries count. .SH "AUTHOR" .IX Header "AUTHOR" Clinton Gormley .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2017 by Elasticsearch \s-1BV.\s0 .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve