-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[7.x][DOCS] Adds Configuration section to Python book
- Loading branch information
1 parent
ca0db1a
commit da6629d
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[[config]] | ||
== Configuration | ||
|
||
This page contains information about the most important configuration options of | ||
the Python {es} client. | ||
|
||
* <<connection-pool>> | ||
* <<connection-selector>> | ||
|
||
|
||
include::connection-pool.asciidoc[] | ||
include::connection-selector.asciidoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[[connection-pool]] | ||
=== Connection pool | ||
|
||
Connection pool is a container that holds the `Connection` instances, manages | ||
the selection process (via a `ConnectionSelector`) and dead connections. | ||
|
||
Initially connections are stored in the class as a list and – along with the | ||
connection options – get passed to the `ConnectionSelector` instance for future | ||
reference. | ||
|
||
Upon each request, the `Transport` asks for a `Connection` via the | ||
`get_connection` method. If the connection fails, it is marked as dead (via | ||
`mark_dead`) and put on a timeout. When the timeout is over the connection is | ||
resurrected and returned to the live pool. A connection that has been previously | ||
marked as dead and then succeeds is marked as live (its fail count is deleted). | ||
|
||
For reference information, refer to the | ||
https://elasticsearch-py.readthedocs.io/en/latest/connection.html#connection-pool[full {es} Python documentation]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[[connection-selector]] | ||
=== Connection selector | ||
|
||
Connection selector is a simple class used to select a connection from a list of | ||
currently live connection instances. Initially, it is passed a dictionary | ||
containing all the connections options which it can then use during the | ||
selection process. When the _select_ method is called it is given a list of | ||
currently live connections to choose from. | ||
|
||
The options dictionary is passed to `Transport` as the hosts parameter and the | ||
same is used to construct the connection object itself. When the connection was | ||
created based on information retrieved from the cluster via the sniffing | ||
process, it is the dictionary returned by the `host_info_callback`. | ||
|
||
Example of where this might be useful is a zone-aware selector that would only | ||
select connections from its own zones and only fall back to other connections | ||
where there would be none in its zones. | ||
|
||
For reference information, refer to the | ||
https://elasticsearch-py.readthedocs.io/en/latest/connection.html#connection-selector[full {es} Python documentation]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters