Class StaticConnectionPool
- Namespace
- Elasticsearch.Net
- Assembly
- Elasticsearch.Net.dll
public class StaticConnectionPool : IConnectionPool, IDisposable
- Inheritance
-
StaticConnectionPool
- Implements
- Derived
- Inherited Members
Constructors
StaticConnectionPool(IEnumerable<Node>, bool, IDateTimeProvider)
public StaticConnectionPool(IEnumerable<Node> nodes, bool randomize = true, IDateTimeProvider dateTimeProvider = null)
Parameters
nodes
IEnumerable<Node>randomize
booldateTimeProvider
IDateTimeProvider
StaticConnectionPool(IEnumerable<Node>, Func<Node, float>, IDateTimeProvider)
protected StaticConnectionPool(IEnumerable<Node> nodes, Func<Node, float> nodeScorer, IDateTimeProvider dateTimeProvider = null)
Parameters
nodes
IEnumerable<Node>nodeScorer
Func<Node, float>dateTimeProvider
IDateTimeProvider
StaticConnectionPool(IEnumerable<Uri>, bool, IDateTimeProvider)
public StaticConnectionPool(IEnumerable<Uri> uris, bool randomize = true, IDateTimeProvider dateTimeProvider = null)
Parameters
uris
IEnumerable<Uri>randomize
booldateTimeProvider
IDateTimeProvider
Fields
GlobalCursor
protected int GlobalCursor
Field Value
Properties
AliveNodes
protected List<Node> AliveNodes { get; }
Property Value
DateTimeProvider
protected IDateTimeProvider DateTimeProvider { get; }
Property Value
InternalNodes
protected List<Node> InternalNodes { get; set; }
Property Value
LastUpdate
public DateTime LastUpdate { get; protected set; }
Property Value
MaxRetries
Returns the default maximum retries for the connection pool implementation. Most implementation default to number of nodes, note that this can be overidden in the connection settings
public int MaxRetries { get; }
Property Value
Nodes
Returns a readonly constant view of all the nodes in the cluster, this might involve creating copies of the nodes e.g if you are using the sniffing connectionpool. If you do not need an isolated copy of the nodes please read CreateView(Action<AuditEvent, Node>) to completion
public virtual IReadOnlyCollection<Node> Nodes { get; }
Property Value
Random
protected Random Random { get; }
Property Value
Randomize
protected bool Randomize { get; }
Property Value
SniffedOnStartup
Bookkeeps wheter this connectionpool has seen a sniff on startup. its up to to the callee to set this in a threadsafe fashion
public bool SniffedOnStartup { get; set; }
Property Value
SupportsPinging
public virtual bool SupportsPinging { get; }
Property Value
SupportsReseeding
Signals that this implemenation can accept new nodes
public virtual bool SupportsReseeding { get; }
Property Value
UsingSsl
Whether or not SSL is being using
public bool UsingSsl { get; }
Property Value
Methods
CreateView(Action<AuditEvent, Node>)
Creates a view of all the live nodes with changing starting positions that wraps over on each call e.g Thread A might get 1,2,3,4,5 and thread B will get 2,3,4,5,1. if there are no live nodes yields a different dead node to try once
public virtual IEnumerable<Node> CreateView(Action<AuditEvent, Node> audit = null)
Parameters
audit
Action<AuditEvent, Node>
Returns
DisposeManagedResources()
protected virtual void DisposeManagedResources()
Reseed(IEnumerable<Node>)
Update the node list, it's the IConnectionPool's responsibility to do so in a threadsafe fashion
public virtual void Reseed(IEnumerable<Node> nodes)
Parameters
nodes
IEnumerable<Node>
RetryInternalNodes(int, Action<AuditEvent, Node>)
protected virtual Node RetryInternalNodes(int globalCursor, Action<AuditEvent, Node> audit = null)
Parameters
globalCursor
intaudit
Action<AuditEvent, Node>
Returns
SelectAliveNodes(int, List<Node>, Action<AuditEvent, Node>)
protected virtual IEnumerable<Node> SelectAliveNodes(int cursor, List<Node> aliveNodes, Action<AuditEvent, Node> audit = null)
Parameters
Returns
SortNodes(IEnumerable<Node>)
protected IOrderedEnumerable<Node> SortNodes(IEnumerable<Node> nodes)
Parameters
nodes
IEnumerable<Node>