Skip to content

Commit 5c03079

Browse files
committed
Update xml-docs to point to Elastic.Transport and generate docs
1 parent 111f304 commit 5c03079

File tree

14 files changed

+61
-49
lines changed

14 files changed

+61
-49
lines changed

docs/client-concepts/connection-pooling/building-blocks/request-pipelines.asciidoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ var pipeline = new RequestPipeline(
2727
settings,
2828
DateTimeProvider.Default,
2929
new RecyclableMemoryStreamFactory(),
30-
new SearchRequestParameters());
30+
new SearchRequestParameters(),
31+
ElasticsearchProductRegistration.Default
32+
);
3133
3234
pipeline.GetType().Should().Implement<IDisposable>();
3335
----
@@ -42,7 +44,9 @@ var requestPipeline = requestPipelineFactory.Create(
4244
settings,
4345
DateTimeProvider.Default, <1>
4446
new RecyclableMemoryStreamFactory(),
45-
new SearchRequestParameters());
47+
new SearchRequestParameters(),
48+
ElasticsearchProductRegistration.Default
49+
);
4650
4751
requestPipeline.Should().BeOfType<RequestPipeline>();
4852
requestPipeline.GetType().Should().Implement<IDisposable>();
@@ -58,7 +62,9 @@ var transport = new Transport<IConnectionSettingsValues>(
5862
settings,
5963
requestPipelineFactory,
6064
DateTimeProvider.Default,
61-
new RecyclableMemoryStreamFactory());
65+
new RecyclableMemoryStreamFactory(),
66+
ElasticsearchProductRegistration.Default
67+
);
6268
6369
var client = new ElasticClient(transport);
6470
----

docs/client-concepts/connection-pooling/building-blocks/transports.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ In the low level client, `ElasticLowLevelClient`, a `Transport` is instantiated
2828

2929
[source,csharp]
3030
----
31-
var lowLevelTransport = new Transport<ConnectionConfiguration>(new ConnectionConfiguration());
31+
var lowLevelTransport = new Transport<ConnectionConfiguration>(new ConnectionConfiguration(), ElasticsearchProductRegistration.Default);
3232
----
3333

3434
and in the high level client, `ElasticClient`, like this
3535

3636
[source,csharp]
3737
----
38-
var highlevelTransport = new Transport<ConnectionSettings>(new ConnectionSettings());
38+
var highlevelTransport = new Transport<ConnectionSettings>(new ConnectionSettings(), ElasticsearchProductRegistration.Default);
3939
4040
var connectionPool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
4141
var inMemoryTransport = new Transport<ConnectionSettings>(
42-
new ConnectionSettings(connectionPool, new InMemoryConnection()));
42+
new ConnectionSettings(connectionPool, new InMemoryConnection()), ElasticsearchProductRegistration.Default);
4343
----
4444

4545
The only two methods on `ITransport` are `Request()` and `RequestAsync()`; the default `ITransport` implementation is responsible for introducing

docs/client-concepts/connection-pooling/exceptions/unexpected-exceptions.asciidoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ please modify the original csharp file found at the link and submit the PR with
1616
=== Unexpected exceptions
1717

1818
When a client call throws an exception that the `IConnection` cannot handle, the exception will bubble
19-
out of the client as an `UnexpectedElasticsearchClientException`, regardless of whether the client is configured to
19+
out of the client as an `UnexpectedTransportException`, regardless of whether the client is configured to
2020
throw exceptions or not.
2121

2222
An `IConnection` is in charge of knowing which exceptions it can recover from and those it can't, and the default `IConnection`
@@ -41,13 +41,13 @@ var audit = new Auditor(() => VirtualClusterWith <1>
4141
4242
audit = await audit.TraceCall(
4343
new ClientCall {
44-
{ AuditEvent.HealthyResponse, 9200 }, <3>
44+
{ HealthyResponse, 9200 }, <3>
4545
}
4646
);
4747
4848
audit = await audit.TraceUnexpectedException(
4949
new ClientCall {
50-
{ AuditEvent.BadResponse, 9201 }, <4>
50+
{ BadResponse, 9201 }, <4>
5151
},
5252
(e) =>
5353
{
@@ -63,7 +63,7 @@ audit = await audit.TraceUnexpectedException(
6363
<4> ...but the second call, to 9201, returns a bad response
6464

6565
Sometimes, an unexpected exception happens further down in the pipeline. In this scenario, we
66-
wrap them inside an `UnexpectedElasticsearchClientException` so that information about where
66+
wrap them inside an `UnexpectedTransportException` so that information about where
6767
in the pipeline the exception happened is not lost.
6868

6969
In this next example, a call to 9200 fails with a `WebException`.
@@ -86,8 +86,8 @@ var audit = new Auditor(() => VirtualClusterWith
8686
8787
audit = await audit.TraceUnexpectedException(
8888
new ClientCall {
89-
{ AuditEvent.BadResponse, 9200 },
90-
{ AuditEvent.BadResponse, 9201 }, <3>
89+
{ BadResponse, 9200 },
90+
{ BadResponse, 9201 }, <3>
9191
},
9292
(e) =>
9393
{
@@ -120,9 +120,9 @@ var audit = new Auditor(() => VirtualClusterWith
120120
121121
audit = await audit.TraceUnexpectedException(
122122
new ClientCall {
123-
{ AuditEvent.PingFailure, 9200 },
124-
{ AuditEvent.PingSuccess, 9201 },
125-
{ AuditEvent.BadResponse, 9201 },
123+
{ PingFailure, 9200 },
124+
{ PingSuccess, 9201 },
125+
{ BadResponse, 9201 },
126126
},
127127
e =>
128128
{
@@ -136,7 +136,7 @@ audit = await audit.TraceUnexpectedException(
136136
pipelineException.FailureReason.Should().Be(PipelineFailure.PingFailure);
137137
pipelineException.InnerException.Message.Should().Be("ping exception");
138138
139-
var pingException = e.AuditTrail.First(a => a.Event == AuditEvent.PingFailure).Exception; <3>
139+
var pingException = e.AuditTrail.First(a => a.Event == PingFailure).Exception; <3>
140140
pingException.Should().NotBeNull();
141141
pingException.Message.Should().Be("ping exception");
142142
}

docs/client-concepts/connection-pooling/exceptions/unrecoverable-exceptions.asciidoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ but by exiting the pipeline.
3131

3232
--
3333

34-
By default, the client won't throw on any `ElasticsearchClientException` but instead return an invalid response
34+
By default, the client won't throw on any `TransportException` but instead return an invalid response
3535
that can be detected by checking the `.IsValid` property on the response. You can change this behaviour with
3636
by using `ThrowExceptions()` on <<configuration-options, `ConnectionSettings`>>.
3737

@@ -90,8 +90,8 @@ followed by a bad response as a result of the 401 bad authentication response
9090
----
9191
audit = await audit.TraceElasticsearchException(
9292
new ClientCall {
93-
{ AuditEvent.PingSuccess, 9200 }, <1>
94-
{ AuditEvent.BadResponse, 9200 }, <2>
93+
{ PingSuccess, 9200 }, <1>
94+
{ BadResponse, 9200 }, <2>
9595
},
9696
exception =>
9797
{
@@ -123,8 +123,8 @@ var audit = new Auditor(() => VirtualClusterWith
123123
124124
audit = await audit.TraceElasticsearchException(
125125
new ClientCall {
126-
{ AuditEvent.PingSuccess, 9200 },
127-
{ AuditEvent.BadResponse, 9201 },
126+
{ PingSuccess, 9200 },
127+
{ BadResponse, 9201 },
128128
},
129129
(e) =>
130130
{
@@ -154,8 +154,8 @@ var audit = new Auditor(() => VirtualClusterWith
154154
155155
audit = await audit.TraceElasticsearchException(
156156
new ClientCall {
157-
{ AuditEvent.PingSuccess, 9200 },
158-
{ AuditEvent.BadResponse, 9200 },
157+
{ PingSuccess, 9200 },
158+
{ BadResponse, 9200 },
159159
},
160160
(e) =>
161161
{

docs/client-concepts/connection-pooling/failover/falling-over.asciidoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ var audit = new Auditor(() => VirtualClusterWith
3030
3131
audit = await audit.TraceCall(
3232
new ClientCall {
33-
{ AuditEvent.BadResponse, 9200 },
34-
{ AuditEvent.HealthyResponse, 9201 },
33+
{ BadResponse, 9200 },
34+
{ HealthyResponse, 9201 },
3535
}
3636
);
3737
----
@@ -53,8 +53,8 @@ var audit = new Auditor(() => VirtualClusterWith
5353
5454
audit = await audit.TraceCall(
5555
new ClientCall {
56-
{ AuditEvent.BadResponse, 9200 },
57-
{ AuditEvent.HealthyResponse, 9201 },
56+
{ BadResponse, 9200 },
57+
{ HealthyResponse, 9201 },
5858
}
5959
);
6060
----
@@ -76,8 +76,8 @@ var audit = new Auditor(() => VirtualClusterWith
7676
7777
audit = await audit.TraceCall(
7878
new ClientCall {
79-
{ AuditEvent.BadResponse, 9200 },
80-
{ AuditEvent.HealthyResponse, 9201 },
79+
{ BadResponse, 9200 },
80+
{ HealthyResponse, 9201 },
8181
}
8282
);
8383
----
@@ -99,8 +99,8 @@ var audit = new Auditor(() => VirtualClusterWith
9999
100100
audit = await audit.TraceCall(
101101
new ClientCall {
102-
{ AuditEvent.BadResponse, 9200 },
103-
{ AuditEvent.HealthyResponse, 9201 },
102+
{ BadResponse, 9200 },
103+
{ HealthyResponse, 9201 },
104104
}
105105
);
106106
----
@@ -122,7 +122,7 @@ var audit = new Auditor(() => VirtualClusterWith
122122
123123
audit = await audit.TraceCall(
124124
new ClientCall {
125-
{ AuditEvent.BadResponse, 9200 },
125+
{ BadResponse, 9200 },
126126
}
127127
);
128128
----

docs/client-concepts/connection-pooling/sniffing/role-detection.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ API call fails because the node predicate filters out all nodes as targets on wh
286286

287287
[source,csharp]
288288
----
289-
await audit.TraceUnexpectedElasticsearchException(new ClientCall
289+
await audit.TraceUnexpectedTransportException(new ClientCall
290290
{
291291
{ SniffOnStartup }, <1>
292292
{ SniffSuccess }, <2>

docs/client-concepts/connection-pooling/sticky/sticky-sniffing-connection-pool.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ the nodes a sniff returns.
2424
----
2525
var numberOfNodes = 10;
2626
var uris = Enumerable.Range(9200, numberOfNodes).Select(p => new Uri("http://localhost:" + p));
27-
var pool = new Elasticsearch.Net.StickySniffingConnectionPool(uris, (n)=>0f);
27+
var pool = new Elastic.Transport.StickySniffingConnectionPool(uris, (n)=>0f);
2828
----
2929

3030
Here we have setup a sticky connection pool seeded with 10 nodes all weighted the same.

docs/client-concepts/connection/configuration-options.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Disables the automatic detection of a proxy
6060

6161
`DisableDirectStreaming`::
6262

63-
Ensures the response bytes are always available on the `ElasticsearchResponse<T>`
63+
Ensures the response bytes are always available on the `ITransportResponse`
6464
+
6565
IMPORTANT: Depending on the registered serializer, this may cause the response to be buffered in memory first, potentially affecting performance.
6666

@@ -182,7 +182,7 @@ Whether the request should be sent with chunked Transfer-Encoding. Default is `f
182182

183183
The user agent string to send with requests. Useful for debugging purposes to understand client and framework versions that initiate requests to Elasticsearch
184184

185-
:xml-docs: Elasticsearch.Net:ConnectionConfiguration`1
185+
:xml-docs: Elastic.Transport:ConnectionConfiguration`1
186186

187187
==== ConnectionConfiguration with ElasticLowLevelClient
188188

docs/client-concepts/high-level/serialization/custom-serialization.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Implementing `IElasticsearchSerializer` is technically enough to inject your own
5959

6060
[source,csharp]
6161
----
62-
public class VanillaSerializer : IElasticsearchSerializer
62+
public class VanillaSerializer : ITransportSerializer
6363
{
6464
public T Deserialize<T>(Stream stream) => throw new NotImplementedException();
6565
@@ -166,7 +166,7 @@ and override the `CreateJsonSerializerSettings` and `ModifyContractResolver` met
166166
----
167167
public class MyFirstCustomJsonNetSerializer : ConnectionSettingsAwareSerializerBase
168168
{
169-
public MyFirstCustomJsonNetSerializer(IElasticsearchSerializer builtinSerializer, IConnectionSettingsValues connectionSettings)
169+
public MyFirstCustomJsonNetSerializer(ITransportSerializer builtinSerializer, IConnectionSettingsValues connectionSettings)
170170
: base(builtinSerializer, connectionSettings) { }
171171
172172
protected override JsonSerializerSettings CreateJsonSerializerSettings() =>
@@ -285,7 +285,7 @@ public class MySecondCustomContractResolver : ConnectionSettingsAwareContractRes
285285
286286
public class MySecondCustomJsonNetSerializer : ConnectionSettingsAwareSerializerBase
287287
{
288-
public MySecondCustomJsonNetSerializer(IElasticsearchSerializer builtinSerializer, IConnectionSettingsValues connectionSettings)
288+
public MySecondCustomJsonNetSerializer(ITransportSerializer builtinSerializer, IConnectionSettingsValues connectionSettings)
289289
: base(builtinSerializer, connectionSettings) { }
290290
291291
protected override JsonSerializerSettings CreateJsonSerializerSettings() =>

docs/client-concepts/troubleshooting/audit-trail.asciidoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ But can also be accessed manually:
7070
[source,csharp]
7171
----
7272
response.ApiCall.AuditTrail.Count.Should().Be(4, "{0}", debug);
73-
response.ApiCall.AuditTrail[0].Event.Should().Be(AuditEvent.SniffOnStartup, "{0}", debug);
74-
response.ApiCall.AuditTrail[1].Event.Should().Be(AuditEvent.SniffSuccess, "{0}", debug);
75-
response.ApiCall.AuditTrail[2].Event.Should().Be(AuditEvent.PingSuccess, "{0}", debug);
76-
response.ApiCall.AuditTrail[3].Event.Should().Be(AuditEvent.HealthyResponse, "{0}", debug);
73+
response.ApiCall.AuditTrail[0].Event.Should().Be(SniffOnStartup, "{0}", debug);
74+
response.ApiCall.AuditTrail[1].Event.Should().Be(SniffSuccess, "{0}", debug);
75+
response.ApiCall.AuditTrail[2].Event.Should().Be(PingSuccess, "{0}", debug);
76+
response.ApiCall.AuditTrail[3].Event.Should().Be(HealthyResponse, "{0}", debug);
7777
----
7878

7979
Each audit has a started and ended `DateTime` on it that will provide

0 commit comments

Comments
 (0)