Skip to content

Commit 0e662d8

Browse files
committed
Fix indendation in doc.cs files which are excluded from the formatter
1 parent 67fe8ce commit 0e662d8

File tree

50 files changed

+3319
-3319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3319
-3319
lines changed

src/Tests/Tests/Aggregations/ReservedAggregationNames.doc.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ public class ReservedAggregationNames : DocumentationTestBase
2626
{
2727
public string[] Reserved => new []
2828
{
29-
"score",
30-
"value_as_string",
31-
"keys",
32-
"max_score"
29+
"score",
30+
"value_as_string",
31+
"keys",
32+
"max_score"
3333
};
3434

35-
//hide
35+
//hide
3636
private TermsAggregation Terms(string name) => new TermsAggregation(name) {Field = "x"};
3737

3838
//hide

src/Tests/Tests/ClientConcepts/Certificates/WorkingWithCertificates.doc.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ public AllowAllSslCertificatesApiTests(AllowAllCertificatesCluster cluster, Endp
116116
*/
117117
public class CertgenCaCluster : SslAndKpiXPackCluster
118118
{
119-
public CertgenCaCluster() : this(new SslAndKpiClusterConfiguration()) { }
120-
public CertgenCaCluster(SslAndKpiClusterConfiguration configuration) : base(configuration) { }
119+
public CertgenCaCluster() : this(new SslAndKpiClusterConfiguration()) { }
120+
public CertgenCaCluster(SslAndKpiClusterConfiguration configuration) : base(configuration) { }
121121
protected override ConnectionSettings ConnectionSettings(ConnectionSettings s) => s
122122
.ServerCertificateValidationCallback(
123123
CertificateValidations.AuthorityIsRoot(new X509Certificate(this.ClusterConfiguration.FileSystem.CaCertificate))

src/Tests/Tests/ClientConcepts/Connection/ConfigurationOptions.doc.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,36 @@ public class ConfigurationOptions
99
{
1010
/**[[configuration-options]]
1111
* === Configuration options
12-
*
13-
* Connecting to Elasticsearch with <<elasticsearch-net-getting-started,Elasticsearch.Net>> and <<nest-getting-started,NEST>> is easy, but
12+
*
13+
* Connecting to Elasticsearch with <<elasticsearch-net-getting-started,Elasticsearch.Net>> and <<nest-getting-started,NEST>> is easy, but
1414
* it's entirely possible that you'd like to change the default connection behaviour. There are a number of configuration options available
1515
* on `ConnectionSettings` (and `ConnectionConfiguration` for Elasticsearch.Net) that can be used to control
1616
* how the clients interact with Elasticsearch.
17-
*
18-
* ==== Options on ConnectionConfiguration
19-
*
20-
* The following is a list of available connection configuration options on `ConnectionConfiguration`; since
21-
* `ConnectionSettings` derives from `ConnectionConfiguration`, these options are available for both
22-
* Elasticsearch.Net and NEST:
23-
*
24-
* :xml-docs: Elasticsearch.Net:ConnectionConfiguration`1
25-
*
26-
* ==== Options on ConnectionSettings
27-
*
28-
* The following is a list of available connection configuration options on `ConnectionSettings`:
29-
*
30-
* :xml-docs: Nest:ConnectionSettingsBase`1
3117
*
32-
* Here's an example to demonstrate setting several configuration options using the low level client
18+
* ==== Options on ConnectionConfiguration
19+
*
20+
* The following is a list of available connection configuration options on `ConnectionConfiguration`; since
21+
* `ConnectionSettings` derives from `ConnectionConfiguration`, these options are available for both
22+
* Elasticsearch.Net and NEST:
23+
*
24+
* :xml-docs: Elasticsearch.Net:ConnectionConfiguration`1
25+
*
26+
* ==== Options on ConnectionSettings
27+
*
28+
* The following is a list of available connection configuration options on `ConnectionSettings`:
29+
*
30+
* :xml-docs: Nest:ConnectionSettingsBase`1
31+
*
32+
* Here's an example to demonstrate setting several configuration options using the low level client
3333
*/
3434
public void AvailableOptions()
3535
{
3636
var connectionConfiguration = new ConnectionConfiguration()
3737
.DisableAutomaticProxyDetection()
3838
.EnableHttpCompression()
3939
.DisableDirectStreaming()
40-
.PrettyJson()
41-
.RequestTimeout(TimeSpan.FromMinutes(2));
40+
.PrettyJson()
41+
.RequestTimeout(TimeSpan.FromMinutes(2));
4242

4343
var lowLevelClient = new ElasticLowLevelClient(connectionConfiguration);
4444

@@ -58,18 +58,18 @@ public void AvailableOptions()
5858
var client = new ElasticClient(connectionSettings);
5959

6060
/**[NOTE]
61-
* ====
62-
*
63-
* Basic Authentication credentials can alternatively be specified on the node URI directly
61+
* ====
62+
*
63+
* Basic Authentication credentials can alternatively be specified on the node URI directly
6464
*/
6565
var uri = new Uri("http://username:password@localhost:9200");
6666
var settings = new ConnectionConfiguration(uri);
6767
}
68-
/**
69-
* but this can be awkward when using connection pooling with multiple nodes, especially when the connection pool
68+
/**
69+
* but this can be awkward when using connection pooling with multiple nodes, especially when the connection pool
7070
* used is one that is capable of reseeding iteslf. For this reason, we'd recommend specifying credentials
7171
* on `ConnectionSettings`.
72-
*====
73-
*/
72+
*====
73+
*/
7474
}
7575
}

src/Tests/Tests/ClientConcepts/Connection/ModifyingDefaultConnection.doc.cs

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -14,99 +14,99 @@
1414

1515
namespace Tests.ClientConcepts.Connection
1616
{
17-
/**[[modifying-default-connection]]
18-
* === Modifying the default connection
19-
*
20-
* The client abstracts sending the request and creating a response behind `IConnection` and the default
21-
* implementation uses
22-
*
23-
* - https://msdn.microsoft.com/en-us/library/system.net.webrequest(v=vs.110).aspx[`System.Net.WebRequest`] for Desktop CLR
24-
* - https://msdn.microsoft.com/en-us/library/system.net.http.httpclient(v=vs.118).aspx[`System.Net.Http.HttpClient`] for Core CLR
25-
*
26-
* The reason for different implementations is that `WebRequest` and `ServicePoint` are not directly available
27-
* on netstandard 1.3.
28-
*
29-
* The Desktop CLR implementation using `WebRequest` is the most mature implementation, having been tried and trusted
30-
* in production since the beginning of NEST. For this reason, we aren't quite ready to it give up in favour of
31-
* a `HttpClient` implementation across all CLR versions.
32-
*
33-
* In addition to production usage, there are also a couple of important toggles that are easy to set against a
34-
* `ServicePoint` that are not possible to set as yet on `HttpClient`.
35-
*
36-
* Finally, another limitation is that `HttpClient` has no synchronous code paths, so supporting these means
37-
* doing hacky async patches which definitely need time to bake.
38-
*
39-
* So why would you ever want to pass your own `IConnection`? Let's look at a couple of examples
40-
*
41-
*/
42-
public class ModifyingTheDefaultConnection
43-
{
44-
/**==== Using InMemoryConnection
45-
*
46-
* `InMemoryConnection` is an in-built `IConnection` that makes it easy to write unit tests against. It can be
47-
* configured to respond with default response bytes, HTTP status code and an exception when a call is made.
48-
*
49-
* `InMemoryConnection` **doesn't actually send any requests or receive any responses from Elasticsearch**;
50-
* requests are still serialized and the request bytes can be obtained on the response if `.DisableDirectStreaming` is
51-
* set to `true` on the request or globally
52-
*/
53-
public void InMemoryConnectionDefaultCtor()
54-
{
55-
var connection = new InMemoryConnection();
56-
var connectionPool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
57-
var settings = new ConnectionSettings(connectionPool, connection);
58-
var client = new ElasticClient(settings);
59-
}
17+
/**[[modifying-default-connection]]
18+
* === Modifying the default connection
19+
*
20+
* The client abstracts sending the request and creating a response behind `IConnection` and the default
21+
* implementation uses
22+
*
23+
* - https://msdn.microsoft.com/en-us/library/system.net.webrequest(v=vs.110).aspx[`System.Net.WebRequest`] for Desktop CLR
24+
* - https://msdn.microsoft.com/en-us/library/system.net.http.httpclient(v=vs.118).aspx[`System.Net.Http.HttpClient`] for Core CLR
25+
*
26+
* The reason for different implementations is that `WebRequest` and `ServicePoint` are not directly available
27+
* on netstandard 1.3.
28+
*
29+
* The Desktop CLR implementation using `WebRequest` is the most mature implementation, having been tried and trusted
30+
* in production since the beginning of NEST. For this reason, we aren't quite ready to it give up in favour of
31+
* a `HttpClient` implementation across all CLR versions.
32+
*
33+
* In addition to production usage, there are also a couple of important toggles that are easy to set against a
34+
* `ServicePoint` that are not possible to set as yet on `HttpClient`.
35+
*
36+
* Finally, another limitation is that `HttpClient` has no synchronous code paths, so supporting these means
37+
* doing hacky async patches which definitely need time to bake.
38+
*
39+
* So why would you ever want to pass your own `IConnection`? Let's look at a couple of examples
40+
*
41+
*/
42+
public class ModifyingTheDefaultConnection
43+
{
44+
/**==== Using InMemoryConnection
45+
*
46+
* `InMemoryConnection` is an in-built `IConnection` that makes it easy to write unit tests against. It can be
47+
* configured to respond with default response bytes, HTTP status code and an exception when a call is made.
48+
*
49+
* `InMemoryConnection` **doesn't actually send any requests or receive any responses from Elasticsearch**;
50+
* requests are still serialized and the request bytes can be obtained on the response if `.DisableDirectStreaming` is
51+
* set to `true` on the request or globally
52+
*/
53+
public void InMemoryConnectionDefaultCtor()
54+
{
55+
var connection = new InMemoryConnection();
56+
var connectionPool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
57+
var settings = new ConnectionSettings(connectionPool, connection);
58+
var client = new ElasticClient(settings);
59+
}
6060

61-
/**
61+
/**
6262
* Here we create a new `ConnectionSettings` by using the overload that takes a `IConnectionPool` and an `IConnection`.
6363
* We pass it an `InMemoryConnection` which, using the default parameterless constructor,
64-
* will return 200 for everything and never actually perform any IO.
65-
*
66-
* Let's see a more complex example
64+
* will return 200 for everything and never actually perform any IO.
65+
*
66+
* Let's see a more complex example
6767
*/
68-
[U]
69-
public void InMemoryConnectionOverloadedCtor()
70-
{
71-
var response = new
72-
{
73-
took = 1,
74-
timed_out = false,
75-
_shards = new
76-
{
77-
total = 2,
78-
successful = 2,
79-
failed = 0
80-
},
81-
hits = new
82-
{
83-
total = 25,
84-
max_score = 1.0,
85-
hits = Enumerable.Range(1, 25).Select(i => (object)new
86-
{
87-
_index = "project",
88-
_type = "project",
89-
_id = $"Project {i}",
90-
_score = 1.0,
91-
_source = new { name = $"Project {i}" }
92-
}).ToArray()
93-
}
94-
};
68+
[U]
69+
public void InMemoryConnectionOverloadedCtor()
70+
{
71+
var response = new
72+
{
73+
took = 1,
74+
timed_out = false,
75+
_shards = new
76+
{
77+
total = 2,
78+
successful = 2,
79+
failed = 0
80+
},
81+
hits = new
82+
{
83+
total = 25,
84+
max_score = 1.0,
85+
hits = Enumerable.Range(1, 25).Select(i => (object)new
86+
{
87+
_index = "project",
88+
_type = "project",
89+
_id = $"Project {i}",
90+
_score = 1.0,
91+
_source = new { name = $"Project {i}" }
92+
}).ToArray()
93+
}
94+
};
9595

96-
var responseBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(response));
97-
var connection = new InMemoryConnection(responseBytes, 200); // <1> `InMemoryConnection` is configured to **always** return `responseBytes` along with a 200 HTTP status code
98-
var connectionPool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
99-
var settings = new ConnectionSettings(connectionPool, connection).DefaultIndex("project");
100-
var client = new ElasticClient(settings);
96+
var responseBytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(response));
97+
var connection = new InMemoryConnection(responseBytes, 200); // <1> `InMemoryConnection` is configured to **always** return `responseBytes` along with a 200 HTTP status code
98+
var connectionPool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
99+
var settings = new ConnectionSettings(connectionPool, connection).DefaultIndex("project");
100+
var client = new ElasticClient(settings);
101101

102-
var searchResponse = client.Search<Project>(s => s.MatchAll());
102+
var searchResponse = client.Search<Project>(s => s.MatchAll());
103103

104-
/**
105-
* We can now assert that the `searchResponse` is valid and contains documents deserialized
106-
* from our fixed `InMemoryConnection` response
107-
*/
108-
searchResponse.ShouldBeValid();
109-
searchResponse.Documents.Count.Should().Be(25);
110-
}
111-
}
104+
/**
105+
* We can now assert that the `searchResponse` is valid and contains documents deserialized
106+
* from our fixed `InMemoryConnection` response
107+
*/
108+
searchResponse.ShouldBeValid();
109+
searchResponse.Documents.Count.Should().Be(25);
110+
}
111+
}
112112
}

src/Tests/Tests/ClientConcepts/ConnectionPooling/BuildingBlocks/ConnectionPooling.doc.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ public class ConnectionPooling
1414
* === Connection pools
1515
* Connection pooling is the internal mechanism that takes care of registering what nodes there are in the cluster and which
1616
* NEST can use to issue client calls on.
17-
*
18-
* [IMPORTANT]
19-
* --
20-
* Despite the name, a connection pool in NEST is **not** like connection pooling that you may be familiar with from
21-
* https://msdn.microsoft.com/en-us/library/bb399543(v=vs.110).aspx[interacting with a database using ADO.Net]; for example,
22-
* a connection pool in NEST is **not** responsible for managing an underlying pool of TCP connections to Elasticsearch,
23-
* this is https://blogs.msdn.microsoft.com/adarshk/2005/01/02/understanding-system-net-connection-management-and-servicepointmanager/[handled by the ServicePointManager in Desktop CLR].
24-
* --
25-
*
26-
* So, what is a connection pool in NEST responsible for? It is responsible for managing the nodes in an Elasticsearch
27-
* cluster to which a connection can be made and there is one instance of an `IConnectionPool` associated with an
28-
* instance of `ConnectionSettings`. Since a <<lifetimes,single client and connection settings instance is recommended for the
29-
* life of the application>>, the lifetime of a single connection pool instance will also be bound to the lifetime
30-
* of the application.
31-
*
32-
* There are four types of connection pool
17+
*
18+
* [IMPORTANT]
19+
* --
20+
* Despite the name, a connection pool in NEST is **not** like connection pooling that you may be familiar with from
21+
* https://msdn.microsoft.com/en-us/library/bb399543(v=vs.110).aspx[interacting with a database using ADO.Net]; for example,
22+
* a connection pool in NEST is **not** responsible for managing an underlying pool of TCP connections to Elasticsearch,
23+
* this is https://blogs.msdn.microsoft.com/adarshk/2005/01/02/understanding-system-net-connection-management-and-servicepointmanager/[handled by the ServicePointManager in Desktop CLR].
24+
* --
25+
*
26+
* So, what is a connection pool in NEST responsible for? It is responsible for managing the nodes in an Elasticsearch
27+
* cluster to which a connection can be made and there is one instance of an `IConnectionPool` associated with an
28+
* instance of `ConnectionSettings`. Since a <<lifetimes,single client and connection settings instance is recommended for the
29+
* life of the application>>, the lifetime of a single connection pool instance will also be bound to the lifetime
30+
* of the application.
31+
*
32+
* There are four types of connection pool
3333
*
3434
* - <<single-node-connection-pool,SingleNodeConnectionPool>>
3535
* - <<static-connection-pool,StaticConnectionPool>>
@@ -201,7 +201,7 @@ [U] public void SniffingSortedSticky()
201201
var pool = new StickySniffingConnectionPool(uris, n =>
202202
(n.ClientNode ? 10 : 0)
203203
+ (n.Settings.TryGetValue("node.attr.rack_id", out var rackId)
204-
&& rackId.ToString() == "rack_one" ? 10 : 0));
204+
&& rackId.ToString() == "rack_one" ? 10 : 0));
205205

206206
pool.SupportsReseeding.Should().BeTrue();
207207
pool.SupportsPinging.Should().BeTrue();

0 commit comments

Comments
 (0)