mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 01:22:26 -04:00
Cleanup Stream usage in various spots (#97306)
Lots of spots where we did weird things around streams like redundant stream creation, redundant collecting before adding all the collected elements to another collection or so, redundant streams for joining strings and using less efficient `Collectors.toList` and in a few cases also incorrectly relying on the result being mutable.
This commit is contained in:
parent
5eeaecd9cf
commit
63e64ae61b
117 changed files with 321 additions and 442 deletions
|
@ -18,7 +18,6 @@ import java.lang.management.GarbageCollectorMXBean;
|
|||
import java.lang.management.ManagementFactory;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public abstract class AbstractBenchmark<T extends Closeable> {
|
||||
private static final int SEARCH_BENCHMARK_ITERATIONS = 10_000;
|
||||
|
@ -92,7 +91,7 @@ public abstract class AbstractBenchmark<T extends Closeable> {
|
|||
String benchmarkTargetHost = args[1];
|
||||
String indexName = args[2];
|
||||
String searchBody = args[3];
|
||||
List<Integer> throughputRates = Arrays.asList(args[4].split(",")).stream().map(Integer::valueOf).collect(Collectors.toList());
|
||||
List<Integer> throughputRates = Arrays.stream(args[4].split(",")).map(Integer::valueOf).toList();
|
||||
|
||||
T client = client(benchmarkTargetHost);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue