Table of Contents

Class SingleNodeConnectionPool

Namespace
Elasticsearch.Net
Assembly
Elasticsearch.Net.dll
public class SingleNodeConnectionPool : IConnectionPool, IDisposable
Inheritance
SingleNodeConnectionPool
Implements
Inherited Members

Constructors

SingleNodeConnectionPool(Uri, IDateTimeProvider)

public SingleNodeConnectionPool(Uri uri, IDateTimeProvider dateTimeProvider = null)

Parameters

uri Uri
dateTimeProvider IDateTimeProvider

Properties

LastUpdate

public DateTime LastUpdate { get; }

Property Value

DateTime

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

int

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 IReadOnlyCollection<Node> Nodes { get; }

Property Value

IReadOnlyCollection<Node>

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

bool

SupportsPinging

public bool SupportsPinging { get; }

Property Value

bool

SupportsReseeding

Signals that this implemenation can accept new nodes

public bool SupportsReseeding { get; }

Property Value

bool

UsingSsl

Whether or not SSL is being using

public bool UsingSsl { get; }

Property Value

bool

Methods

CreateView(Action<AuditEvent, Node>)

Creates a view 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 IEnumerable<Node> CreateView(Action<AuditEvent, Node> audit = null)

Parameters

audit Action<AuditEvent, Node>

Returns

IEnumerable<Node>

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 void Reseed(IEnumerable<Node> nodes)

Parameters

nodes IEnumerable<Node>