.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Search::Elasticsearch::Role::CxnPool::Sniff 3pm" .TH Search::Elasticsearch::Role::CxnPool::Sniff 3pm 2024-02-04 "perl v5.38.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::Sniff \- A CxnPool role for connecting to a local cluster with a dynamic node list .SH VERSION .IX Header "VERSION" version 8.12 .SH CONFIGURATION .IX Header "CONFIGURATION" .ie n .SS """sniff_interval""" .el .SS \f(CWsniff_interval\fP .IX Subsection "sniff_interval" How often should we perform a sniff in order to detect whether new nodes have been added to the cluster. Defaults to `300` seconds. .ie n .SS """sniff_max_content_length""" .el .SS \f(CWsniff_max_content_length\fP .IX Subsection "sniff_max_content_length" Whether we should set the max_content_length dynamically while sniffing. Defaults to true unless a fixed \&\f(CW\*(C`max_content_length\*(C'\fR was specified. .SH METHODS .IX Header "METHODS" .ie n .SS schedule_check() .el .SS \f(CWschedule_check()\fP .IX Subsection "schedule_check()" .Vb 1 \& $cxn_pool\->schedule_check .Ve .PP Schedules a sniff before the next request is processed. .ie n .SS parse_sniff() .el .SS \f(CWparse_sniff()\fP .IX Subsection "parse_sniff()" .Vb 1 \& $bool = $cxn_pool\->parse_sniff(\e%nodes); .Ve .PP Parses the response from a sniff request and extracts the hostname/ip of all listed nodes, filtered through "\fBshould_accept_node()\fR". If any live nodes are found, they are passed to "\fBset_cxns()\fR" in Search::Elasticsearch::Role::CxnPool. The max_content_length is also detected if "sniff_max_content_length" is true. .ie n .SS should_accept_node() .el .SS \f(CWshould_accept_node()\fP .IX Subsection "should_accept_node()" .Vb 1 \& $host = $cxn_pool\->should_accept_node($host,$node_id,\e%node_data) .Ve .PP This method serves as a hook which can be overridden by the user. When a sniff is performed, this method is called with the \f(CW\*(C`host\*(C'\fR (eg \f(CW\*(C`192.168.5.100:9200\*(C'\fR), the \f(CW\*(C`node_id\*(C'\fR (the ID assigned to the node by Elasticsearch) and the \f(CW\*(C`node_data\*(C'\fR which contains the information about the node that Elasticsearch has returned, eg: .PP .Vb 10 \& { \& "transport_address" => "inet[192.168.5.100/192.168.5.100:9300]", \& "http" : { \& "publish_address" => "inet[/192.168.5.100:9200]", \& "max_content_length" => "100mb", \& "bound_address" => "inet[/0:0:0:0:0:0:0:0:9200]", \& "max_content_length_in_bytes" : 104857600 \& }, \& "version" => "0.90.4", \& "name" => "Silver Sable", \& "hostname" => "search1.domain.com", \& "http_address" => "inet[/192.168.5.100:9200]" \& } .Ve .PP If the node should be \fIaccepted\fR (ie used to serve data), then it should return the \f(CW\*(C`host\*(C'\fR value to use. By default, nodes are always accepted. .SH AUTHOR .IX Header "AUTHOR" Enrico Zimuel .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2024 by Elasticsearch BV. .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve