Skip to content

Commit 70a0c9b

Browse files
authored
Merge pull request #2324 from FoneticSolutions/2308-tookDeserializationOnMaster
Change type of took field in responses
2 parents dadab74 + f2f09dc commit 70a0c9b

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

src/Benchmarking/PartitionExtension.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ public static IEnumerable<IEnumerable<T>> Partition<T>(this IEnumerable<T> sourc
3535
}
3636
}
3737

38-
public static decimal GetMedian(this IEnumerable<int> source)
38+
public static decimal GetMedian(this IEnumerable<long> source)
3939
{
4040
// Create a copy of the input, and sort the copy
41-
int[] temp = source.ToArray();
41+
long[] temp = source.ToArray();
4242
Array.Sort(temp);
4343

4444
int count = temp.Length;
@@ -50,13 +50,13 @@ public static decimal GetMedian(this IEnumerable<int> source)
5050
if (count % 2 == 0)
5151
{
5252
// count is even, average two middle elements
53-
int a = temp[count / 2 - 1];
54-
int b = temp[count / 2];
53+
long a = temp[count / 2 - 1];
54+
long b = temp[count / 2];
5555
return (a + b) / 2m;
5656
}
57-
57+
5858
// count is odd, return the middle element
5959
return temp[count / 2];
6060
}
6161
}
62-
}
62+
}

src/Benchmarking/Results.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class Results
1515

1616
public int IndexedDocuments { get; set; }
1717

18-
public IEnumerable<int> EsTimings { get; set; }
18+
public IEnumerable<long> EsTimings { get; set; }
1919

2020
public Metrics Before { get; set; }
2121

@@ -30,4 +30,4 @@ public void Write(TextWriter output)
3030
output.WriteLine(" memory after:{0} thread count after:{1}", After.MemorySize.Bytes(), After.ThreadCount);
3131
}
3232
}
33-
}
33+
}

src/Benchmarking/Tester.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public Results RunTests(int numMessages = NumberOfMessages, int bufferSize = Buf
7575

7676
protected ConnectionSettings CreateSettings()
7777
{
78-
var host = Process.GetProcessesByName("fiddler").Any()
78+
var host = Process.GetProcessesByName("fiddler").Any()
7979
? "ipv4.fiddler"
8080
: "localhost";
8181

@@ -99,7 +99,7 @@ protected void Connect()
9999
protected class IndexResults
100100
{
101101
public double Elapsed { get; set; }
102-
public IEnumerable<int> EsTimings { get; set; }
102+
public IEnumerable<long> EsTimings { get; set; }
103103
}
104104

105105
protected IndexResults GenerateAndIndex(int numMessages, int bufferSize)
@@ -173,4 +173,4 @@ public void SearchUsingSingleClient(int numberOfSearches)
173173
System.Threading.Tasks.Task.WaitAll(tasks.ToArray());
174174
}
175175
}
176-
}
176+
}

src/Nest/Document/Multiple/Bulk/BulkResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Nest
77
{
88
public interface IBulkResponse : IResponse
99
{
10-
int Took { get; }
10+
long Took { get; }
1111
bool Errors { get; }
1212
IEnumerable<BulkResponseItemBase> Items { get; }
1313
IEnumerable<BulkResponseItemBase> ItemsWithErrors { get; }
@@ -26,7 +26,7 @@ protected override void DebugIsValid(StringBuilder sb)
2626
}
2727

2828
[JsonProperty("took")]
29-
public int Took { get; internal set; }
29+
public long Took { get; internal set; }
3030

3131
[JsonProperty("errors")]
3232
public bool Errors { get; internal set; }

src/Nest/Document/Single/TermVectors/TermVectorsResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public interface ITermVectorsResponse : IResponse
1010
string Id { get; }
1111
long Version { get; }
1212
bool Found { get; }
13-
int Took { get; }
13+
long Took { get; }
1414
IDictionary<string, TermVector> TermVectors { get; }
1515
}
1616

@@ -33,7 +33,7 @@ public class TermVectorsResponse : ResponseBase, ITermVectorsResponse
3333
public bool Found { get; internal set; }
3434

3535
[JsonProperty(PropertyName = "took")]
36-
public int Took { get; internal set; }
36+
public long Took { get; internal set; }
3737

3838
[JsonProperty("term_vectors")]
3939
public IDictionary<string, TermVector> TermVectors { get; internal set; } = new Dictionary<string, TermVector>();

src/Nest/Search/Percolator/Percolate/PercolateResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Nest
88
[Obsolete("Deprecated. Will be removed in the next major release. Use a percolate query with search api")]
99
public interface IPercolateCountResponse : IResponse
1010
{
11-
int Took { get; }
11+
long Took { get; }
1212
long Total { get; }
1313
}
1414

@@ -23,7 +23,7 @@ public interface IPercolateResponse : IPercolateCountResponse
2323
public class PercolateCountResponse : ResponseBase, IPercolateCountResponse
2424
{
2525
[JsonProperty(PropertyName = "took")]
26-
public int Took { get; internal set; }
26+
public long Took { get; internal set; }
2727

2828
[JsonProperty(PropertyName = "total")]
2929
public long Total { get; internal set; }

src/Nest/Search/Search/SearchResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public interface ISearchResponse<T> : IResponse where T : class
1414
Profile Profile { get; }
1515
AggregationsHelper Aggs { get; }
1616
IDictionary<string, Suggest<T>[]> Suggest { get; }
17-
int Took { get; }
17+
long Took { get; }
1818
bool TimedOut { get; }
1919
bool TerminatedEarly { get; }
2020
string ScrollId { get; }
@@ -61,7 +61,7 @@ public class SearchResponse<T> : ResponseBase, ISearchResponse<T> where T : clas
6161
public IDictionary<string, Suggest<T>[]> Suggest { get; internal set; }
6262

6363
[JsonProperty(PropertyName = "took")]
64-
public int Took { get; internal set; }
64+
public long Took { get; internal set; }
6565

6666
[JsonProperty("timed_out")]
6767
public bool TimedOut { get; internal set; }

0 commit comments

Comments
 (0)