Skip to content

Commit aca54bb

Browse files
committed
renamed GetRootNodeInfo to RootNodeInfo
1 parent 1452cec commit aca54bb

File tree

7 files changed

+15
-19
lines changed

7 files changed

+15
-19
lines changed

src/Nest.Tests.Integration/Connection/Thrift/ThiftBugReportTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ThiftBugReportTests : IntegrationTests
1414
[Test]
1515
public void IndexExistShouldNotThrowOn404()
1616
{
17-
var isValidThriftConnection = this._thriftClient.GetRootNodeInfo().IsValid;
17+
var isValidThriftConnection = this._thriftClient.RootNodeInfo().IsValid;
1818
isValidThriftConnection.Should().BeTrue();
1919

2020
var unknownIndexResult = this._thriftClient.IndexExists("i-am-running-out-of-clever-index-names");

src/Nest.Tests.Integration/ConnectionTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void TestSettingsWithUri()
3131
[Test]
3232
public void TestConnectSuccess()
3333
{
34-
var rootNodeInfo = _client.GetRootNodeInfo();
34+
var rootNodeInfo = _client.RootNodeInfo();
3535
Assert.True(rootNodeInfo.IsValid);
3636
Assert.Null(rootNodeInfo.ConnectionStatus.Error);
3737
}
@@ -72,7 +72,7 @@ public void connect_to_unknown_hostname()
7272
{
7373
var settings = new ConnectionSettings(new Uri("http://youdontownthis.domain.do.you"));
7474
var client = new ElasticClient(settings);
75-
var result = client.GetRootNodeInfo();
75+
var result = client.RootNodeInfo();
7676

7777
Assert.False(result.IsValid);
7878
Assert.NotNull(result.ConnectionStatus);
@@ -86,7 +86,7 @@ public void TestConnectSuccessWithUri()
8686
{
8787
var settings = new ConnectionSettings(Test.Default.Uri);
8888
var client = new ElasticClient(settings);
89-
var result = client.GetRootNodeInfo();
89+
var result = client.RootNodeInfo();
9090

9191
Assert.True(result.IsValid);
9292
Assert.Null(result.ConnectionStatus.Error);

src/Nest/ElasticClient-Statics.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public string GetTypeNameFor<T>()
2626
{
2727
return GetTypeNameFor(typeof (T));
2828
}
29+
2930
public string GetTypeNameFor(Type type)
3031
{
3132
return this.TypeNameResolver.GetTypeNameFor(type).Resolve(this._connectionSettings);
@@ -35,15 +36,12 @@ public string GetIndexNameFor<T>()
3536
{
3637
return GetIndexNameFor(typeof(T));
3738
}
39+
3840
public string GetIndexNameFor(Type type)
3941
{
4042
return this.IndexNameResolver.GetIndexForType(type);
4143
}
4244

43-
/// <summary>
44-
/// Returns a response of type R based on the connection status by trying parsing status.Result into R
45-
/// </summary>
46-
/// <returns></returns>
4745
protected virtual R ToParsedResponse<R>(ConnectionStatus status, bool allow404 = false, IEnumerable<JsonConverter> extraConverters = null) where R : BaseResponse
4846
{
4947
return this.Serializer.ToParsedResponse<R>(status, allow404, extraConverters);

src/Nest/ElasticClient.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,18 @@ public ElasticClient(IConnectionSettings settings, IConnection connection)
5050
/// Get the data when you hit the elasticsearch endpoint at the too
5151
/// </summary>
5252
/// <returns></returns>
53-
public IRootInfoResponse GetRootNodeInfo()
53+
public IRootInfoResponse RootNodeInfo()
5454
{
5555
var response = this.Connection.GetSync("/");
5656
return response.ToParsedResponse<RootInfoResponse>();
5757

5858
}
59+
5960
/// <summary>
6061
/// Get the data when you hit the elasticsearch endpoint at the too
6162
/// </summary>
6263
/// <returns></returns>
63-
public Task<IRootInfoResponse> GetRootNodeInfoAsync()
64+
public Task<IRootInfoResponse> RootNodeInfoAsync()
6465
{
6566
var response = this.Connection.Get("/");
6667
return response

src/Nest/IElasticClient.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace Nest
88
{
99
public interface IElasticClient
1010
{
11-
1211
IConnection Connection { get; }
1312
ElasticSerializer Serializer { get; }
1413
IRawElasticClient Raw { get; }
@@ -18,7 +17,6 @@ public interface IElasticClient
1817
string GetIndexNameFor<T>();
1918
string GetIndexNameFor(Type type);
2019

21-
2220
IIndicesOperationResponse Alias(AliasParams aliasParams);
2321
IIndicesOperationResponse Alias(IEnumerable<AliasParams> aliases);
2422
IIndicesOperationResponse Alias(IEnumerable<string> aliases);
@@ -296,11 +294,9 @@ Task<IRegisterPercolateResponse> RegisterPercolatorAsync<T>(
296294
IIndicesOperationResponse RemoveAliases(IEnumerable<AliasParams> aliases);
297295
IIndicesOperationResponse Rename(string index, string oldAlias, string newAlias);
298296

299-
300297
IQueryResponse<dynamic> Scroll(string scrollTime, string scrollId);
301298
IQueryResponse<T> Scroll<T>(string scrollTime, string scrollId) where T : class;
302299

303-
304300
IQueryResponse<dynamic> Search(Func<SearchDescriptor<dynamic>, SearchDescriptor<dynamic>> searcher);
305301
IQueryResponse<T> Search<T>(SearchDescriptor<T> descriptor) where T : class;
306302
IQueryResponse<T> Search<T>(Func<SearchDescriptor<T>, SearchDescriptor<T>> searcher) where T : class;
@@ -337,8 +333,9 @@ IUpdateResponse Update<T, K>(Action<UpdateDescriptor<T, K>> updateSelector)
337333

338334
IValidateResponse Validate<T>(Action<ValidateQueryPathDescriptor<T>> querySelector) where T : class;
339335

340-
IRootInfoResponse GetRootNodeInfo();
341-
Task<IRootInfoResponse> GetRootNodeInfoAsync();
336+
IRootInfoResponse RootNodeInfo();
337+
338+
Task<IRootInfoResponse> RootNodeInfoAsync();
342339

343340
}
344341
}

src/ProtocolLoadTest/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private static void RecreateIndex(string suffix)
8282

8383
var client = new ElasticClient(connSettings);
8484

85-
var result = client.GetRootNodeInfo();
85+
var result = client.RootNodeInfo();
8686
if (!result.IsValid)
8787
{
8888
Console.Error.WriteLine("Could not connect to {0}:\r\n{1}",
@@ -115,7 +115,7 @@ private static void CloseIndex(string suffix)
115115

116116
var client = new ElasticClient(connSettings);
117117

118-
var result = client.GetRootNodeInfo();
118+
var result = client.RootNodeInfo();
119119
if (!result.IsValid)
120120
{
121121
Console.Error.WriteLine("Could not connect to {0}:\r\n{1}",

src/ProtocolLoadTest/Tester.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected ConnectionSettings CreateSettings(string indexName, int port)
2626

2727
protected void Connect(ElasticClient client, ConnectionSettings settings)
2828
{
29-
var result = client.GetRootNodeInfo();
29+
var result = client.RootNodeInfo();
3030
if (!result.IsValid)
3131
{
3232
Console.Error.WriteLine("Could not connect to {0}:\r\n{1}",

0 commit comments

Comments
 (0)