Class SniffingConnectionPool
- Namespace
- Elasticsearch.Net
- Assembly
- Elasticsearch.Net.dll
public class SniffingConnectionPool : StaticConnectionPool, IConnectionPool, IDisposable
- Inheritance
-
SniffingConnectionPool
- Implements
- Derived
- Inherited Members
Constructors
SniffingConnectionPool(IEnumerable<Node>, bool, IDateTimeProvider)
public SniffingConnectionPool(IEnumerable<Node> nodes, bool randomize = true, IDateTimeProvider dateTimeProvider = null)
Parameters
nodes
IEnumerable<Node>randomize
booldateTimeProvider
IDateTimeProvider
SniffingConnectionPool(IEnumerable<Node>, Func<Node, float>, IDateTimeProvider)
public SniffingConnectionPool(IEnumerable<Node> nodes, Func<Node, float> nodeScorer, IDateTimeProvider dateTimeProvider = null)
Parameters
nodes
IEnumerable<Node>nodeScorer
Func<Node, float>dateTimeProvider
IDateTimeProvider
SniffingConnectionPool(IEnumerable<Uri>, bool, IDateTimeProvider)
public SniffingConnectionPool(IEnumerable<Uri> uris, bool randomize = true, IDateTimeProvider dateTimeProvider = null)
Parameters
uris
IEnumerable<Uri>randomize
booldateTimeProvider
IDateTimeProvider
Properties
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 override IReadOnlyCollection<Node> Nodes { get; }
Property Value
SupportsPinging
public override bool SupportsPinging { get; }
Property Value
SupportsReseeding
Signals that this implemenation can accept new nodes
public override bool SupportsReseeding { 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 override IEnumerable<Node> CreateView(Action<AuditEvent, Node> audit = null)
Parameters
audit
Action<AuditEvent, Node>
Returns
DisposeManagedResources()
protected override void DisposeManagedResources()
Reseed(IEnumerable<Node>)
Update the node list, it's the IConnectionPool's responsibility to do so in a threadsafe fashion
public override void Reseed(IEnumerable<Node> nodes)
Parameters
nodes
IEnumerable<Node>