-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
SingleNodeConnectionPool.cs
51 lines (41 loc) · 1.09 KB
/
SingleNodeConnectionPool.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using Elasticsearch.Net.Connection;
namespace Elasticsearch.Net.ConnectionPool
{
public class SingleNodeConnectionPool : IConnectionPool
{
private readonly Uri _uri;
public int MaxRetries { get { return 0; } }
public bool AcceptsUpdates { get { return false; } }
public bool UsingSsl { get { return _uri.Scheme == Uri.UriSchemeHttps; } }
public bool SniffedOnStartup
{
get { return false; }
set { }
}
public SingleNodeConnectionPool(Uri uri)
{
//this makes sure that paths stay relative i.e if the root uri is:
//http://my-saas-provider.com/instance
if (!uri.OriginalString.EndsWith("/"))
uri = new Uri(uri.OriginalString + "/");
_uri = uri;
}
public Uri GetNext(int? initialSeed, out int seed, out bool shouldPingHint)
{
seed = 0;
shouldPingHint = false;
return _uri;
}
public void MarkDead(Uri uri, int? deadTimeout = null, int? maxDeadTimeout = null)
{
}
public void MarkAlive(Uri uri)
{
}
public void UpdateNodeList(IList<Uri> newClusterState, Uri sniffNode = null)
{
}
}
}