Search...Static(3pm)

πŸ“¦
version 8.12 Β· 5 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Search...Static(3pm) πŸ’–

okay bestie, welcome to the Search...Static(3pm) page, straight out of the User Contributed Perl Documentation. it's giving very demure, very mindful, very static list of nodes. let's get into it πŸ¦‹


✨ NAME ✨

Search::Elasticsearch::CxnPool::Static β€” a CxnPool for connecting to a remote cluster with a static list of nodes. no cap, that's the whole vibe. πŸ’…


🌸 VERSION 🌸

version 8.12 β€” she's current, she's fresh, she's slaying. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

$e = Search::Elasticsearch->new(
    cxn_pool => 'Static'     # default
    nodes    => [
        'search1:9200',
        'search2:9200'
    ],
);

look at her. so simple. so clean. the cxn_pool => 'Static' is literally the default, so you don't even gotta say it if you don't wanna. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so the Static connection pool is the default one, and you should use her when you don't have direct access to the Elasticsearch cluster β€” like, say, when you're hitting the cluster through a proxy. 🫢

what she does is round-robin through the nodes you specified, and she pings each node before it gets used for the first time, just to make sure it's actually responding. vibe check, basically. πŸ’…

and if any node fails? 😭 then all the nodes get pinged before the next request, to confirm they're all still alive and responding. failed nodes get pinged regularly too, to check if they've recovered. she's keeping tabs, she's not letting anybody ghost her. πŸ’€

this class does Search::Elasticsearch::Role::CxnPool::Static and Search::Elasticsearch::Role::Is_Sync. iconic behavior tbh.


🌈 CONFIGURATION 🌈

πŸ’œ nodes

the list of nodes to use to serve requests. can accept a single node, multiple nodes, and defaults to localhost:9200 if no nodes are specified. see "node" in Search::Elasticsearch::Role::Cxn for the details of the node specification. πŸ“‹

πŸ“ See also

  • "request_timeout" in Search::Elasticsearch::Role::Cxn
  • "ping_timeout" in Search::Elasticsearch::Role::Cxn
  • "dead_timeout" in Search::Elasticsearch::Role::Cxn
  • "max_dead_timeout" in Search::Elasticsearch::Role::Cxn

🧚 Inherited configuration

from Search::Elasticsearch::Role::CxnPool:

  • randomize_cxns

πŸ”₯ METHODS πŸ”₯

⭐ next_cxn()

$cxn = $cxn_pool->next_cxn

returns the next available live node β€” in round robin fashion, obviously, she's fair β€” or throws a NoNodes error if no nodes respond to ping requests. 😭 and yes, that error is a real thing that can happen, so be ready.

πŸ’… Inherited methods

from Search::Elasticsearch::Role::CxnPool::Static:

  • schedule_check()

from Search::Elasticsearch::Role::CxnPool:

  • cxn_factory()
  • logger()
  • serializer()
  • current_cxn_num()
  • cxns()
  • seed_nodes()
  • next_cxn_num()
  • set_cxns()
  • request_ok()
  • request_failed()
  • should_retry()
  • should_mark_dead()
  • cxns_str()
  • cxns_seeds_str()
  • retries()
  • reset_retries()

look at that list. she inherited everything. main character energy fr fr. πŸ‘‘


πŸ‘‘ AUTHOR πŸ‘‘

Enrico Zimuel <enrico.zimuel@elastic.co>


this software is Copyright (c) 2024 by Elasticsearch BV.

this is free software, licensed under:

The Apache License, Version 2.0, January 2004

and that's the whole page, bestie!! πŸŽ€ this lil' rewrite came to you courtesy of perl v5.38.2, dated 2024-02-04 β€” so if you're reading this in some distant future, just know she was written on that day and she ATE. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from