Skip to content

Commit 43865b2

Browse files
committed
Merge branch 'fix/todo-sweap'
2 parents 10ee84a + 6b5a08e commit 43865b2

File tree

18 files changed

+24
-58
lines changed

18 files changed

+24
-58
lines changed

build/scripts/Targets.fsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ Target "Benchmark" <| fun _ -> Benchmarker.Run()
4242

4343
Target "Documentation" <| fun _ -> Documentation.Generate()
4444

45-
Target "QuickCompile" <| fun _ -> Build.QuickCompile()
46-
4745
Target "Version" <| fun _ ->
4846
Versioning.PatchAssemblyInfos()
4947
Versioning.PatchProjectJsons()

src/Elasticsearch.Net/Transport/Transport.cs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ namespace Elasticsearch.Net
88
public class Transport<TConnectionSettings> : ITransport<TConnectionSettings>
99
where TConnectionSettings : IConnectionConfigurationValues
1010
{
11-
//TODO should all of these be public?
1211
public TConnectionSettings Settings { get; }
13-
public IDateTimeProvider DateTimeProvider { get; }
14-
public IMemoryStreamFactory MemoryStreamFactory { get; }
15-
public IRequestPipelineFactory PipelineProvider { get; }
12+
13+
private IDateTimeProvider DateTimeProvider { get; }
14+
private IMemoryStreamFactory MemoryStreamFactory { get; }
15+
private IRequestPipelineFactory PipelineProvider { get; }
1616

1717
/// <summary>
1818
/// Transport coordinates the client requests over the connection pool nodes and is in charge of falling over on different nodes
@@ -43,7 +43,7 @@ IMemoryStreamFactory memoryStreamFactory
4343

4444
this.Settings = configurationValues;
4545
this.PipelineProvider = pipelineProvider ?? new RequestPipelineFactory();
46-
this.DateTimeProvider = dateTimeProvider ?? Net.DateTimeProvider.Default;
46+
this.DateTimeProvider = dateTimeProvider ?? Elasticsearch.Net.DateTimeProvider.Default;
4747
this.MemoryStreamFactory = memoryStreamFactory ?? new MemoryStreamFactory();
4848
}
4949

@@ -93,11 +93,9 @@ public ElasticsearchResponse<TReturn> Request<TReturn>(HttpMethod method, string
9393
AuditTrail = pipeline?.AuditTrail
9494
};
9595
}
96-
if (response != null && response.SuccessOrKnownError)
97-
{
98-
pipeline.MarkAlive(node);
99-
break;
100-
}
96+
if (response == null || !response.SuccessOrKnownError) continue;
97+
pipeline.MarkAlive(node);
98+
break;
10199
}
102100
if (response == null || !response.Success)
103101
pipeline.BadResponse(ref response, requestData, seenExceptions);
@@ -154,11 +152,9 @@ public async Task<ElasticsearchResponse<TReturn>> RequestAsync<TReturn>(HttpMeth
154152
AuditTrail = pipeline.AuditTrail
155153
};
156154
}
157-
if (response != null && response.SuccessOrKnownError)
158-
{
159-
pipeline.MarkAlive(node);
160-
break;
161-
}
155+
if (response == null || !response.SuccessOrKnownError) continue;
156+
pipeline.MarkAlive(node);
157+
break;
162158
}
163159
if (response == null || !response.Success)
164160
pipeline.BadResponse(ref response, requestData, seenExceptions);

src/Nest/Aggregations/Bucket/Filters/NamedFiltersContainer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace Nest
77
{
8-
//TODO dict of string QUeryContainer?
98
[JsonConverter(typeof(VerbatimDictionaryKeysJsonConverter<NamedFiltersContainer, string, IQueryContainer>))]
109
public interface INamedFiltersContainer : IIsADictionary<string, IQueryContainer>
1110
{

src/Nest/Cluster/ClusterReroute/ClusterRerouteResponse.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ public interface IClusterRerouteResponse : IResponse
1414

1515
public class ClusterRerouteResponse : ResponseBase, IClusterRerouteResponse
1616
{
17-
//TODO why is this not on the interface?
18-
public int Version { get; internal set; }
1917
public ClusterRerouteState State { get; internal set; }
20-
public IReadOnlyCollection<ClusterRerouteExplanation> Explanations { get; } = EmptyReadOnly<ClusterRerouteExplanation>.Collection;
18+
public IReadOnlyCollection<ClusterRerouteExplanation> Explanations { get; internal set; } = EmptyReadOnly<ClusterRerouteExplanation>.Collection;
2119
}
2220
}

src/Nest/CommonAbstractions/Infer/Inferrer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ public class Inferrer
1717
private TypeNameResolver TypeNameResolver { get; }
1818
private FieldResolver FieldResolver { get; }
1919

20-
// TODO: Find some better place for this
21-
internal ConcurrentDictionary<Type, JsonContract> Contracts { get; set; }
22-
internal ConcurrentDictionary<Type, Action<MultiGetHitJsonConverter.MultiHitTuple, JsonSerializer, ICollection<IMultiGetHit<object>>>> CreateMultiHitDelegates { get; set; }
23-
internal ConcurrentDictionary<Type, Action<MultiSearchResponseJsonConverter.SearchHitTuple, JsonSerializer, IDictionary<string, object>>> CreateSearchResponseDelegates { get; set; }
20+
internal ConcurrentDictionary<Type, JsonContract> Contracts { get; }
21+
internal ConcurrentDictionary<Type, Action<MultiGetHitJsonConverter.MultiHitTuple, JsonSerializer, ICollection<IMultiGetHit<object>>>> CreateMultiHitDelegates { get; }
22+
internal ConcurrentDictionary<Type, Action<MultiSearchResponseJsonConverter.SearchHitTuple, JsonSerializer, IDictionary<string, object>>> CreateSearchResponseDelegates { get; }
2423

2524
public Inferrer(IConnectionSettingsValues connectionSettings)
2625
{
@@ -30,6 +29,7 @@ public Inferrer(IConnectionSettingsValues connectionSettings)
3029
this.IndexNameResolver = new IndexNameResolver(connectionSettings);
3130
this.TypeNameResolver = new TypeNameResolver(connectionSettings);
3231
this.FieldResolver = new FieldResolver(connectionSettings);
32+
3333
this.Contracts = new ConcurrentDictionary<Type, JsonContract>();
3434
this.CreateMultiHitDelegates = new ConcurrentDictionary<Type, Action<MultiGetHitJsonConverter.MultiHitTuple, JsonSerializer, ICollection<IMultiGetHit<object>>>>();
3535
this.CreateSearchResponseDelegates = new ConcurrentDictionary<Type, Action<MultiSearchResponseJsonConverter.SearchHitTuple, JsonSerializer, IDictionary<string, object>>>();

src/Nest/CommonAbstractions/SerializationBehavior/GenericJsonConverters/KeyValueJsonConverter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ internal class KeyValueConversion
3131
public JsonProperty ValueProperty { get; set; }
3232
}
3333

34-
35-
//TODO this serializer feels to generalized since it relies on reflection and caching in KnownTypes :/
3634
internal class KeyValueJsonConverter<TContainer, TValue> : JsonConverter
3735
where TContainer : class, new()
3836
{

src/Nest/CommonAbstractions/SerializationBehavior/JsonNetSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class JsonNetSerializer : IElasticsearchSerializer
2626
/// <summary>
2727
/// Resolves JsonContracts for types
2828
/// </summary>
29-
protected ElasticContractResolver ContractResolver { get; }
29+
private ElasticContractResolver ContractResolver { get; }
3030

3131
//TODO this internal smells
3232
internal JsonSerializer Serializer => _defaultSerializer;

src/Nest/Document/Single/Delete/ElasticClient-Delete.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@
55

66
namespace Nest
77
{
8-
//TODO I Deleted DeleteExtensions, when we introduced Document as a parameter folks can do
9-
10-
//.Delete<T>(id)
11-
//.Delete(Document.Id<T>(2))
12-
//.Delete<T>(T object)
13-
//.Delete(Document.Infer<T>(2))
14-
15-
16-
//Delete(Document.Index("a").Type("x").Id("1"), s=>s)
17-
//Delete(Document.Infer(doc), s=>s)
18-
//Delete(Document.Index<T>().Type<TOptional>().Id(2), s=>s)
198
public partial interface IElasticClient
209
{
2110
/// <summary>

src/Nest/Document/Single/Update/UpdateRequest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace Nest
77
{
8-
//TODO we used to to a complex infer on Id, if its empty first try on Doc otherwise on Upsert doc, is this still valid?
98
public partial interface IUpdateRequest<TDocument, TPartialDocument>
109
where TDocument : class
1110
where TPartialDocument : class

src/Nest/Indices/MappingManagement/GetFieldMapping/GetFieldMappingRequest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ public partial interface IGetFieldMappingRequest { }
44

55
public partial class GetFieldMappingRequest { }
66

7-
//TODO Removed typed request validate this is still valid
8-
97
[DescriptorFor("IndicesGetFieldMapping")]
108
public partial class GetFieldMappingDescriptor<T> where T : class { }
119
}

0 commit comments

Comments
 (0)