From f3755660d4e2810935bb73f0f356d1e875824dc0 Mon Sep 17 00:00:00 2001 From: Jia-Sheng Chen Date: Fri, 26 May 2023 11:12:18 +0800 Subject: [PATCH] update Collectors.toUnmodifiableList() to toList() --- .../java/org/astraea/connector/perf/PerfSource.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/connector/src/main/java/org/astraea/connector/perf/PerfSource.java b/connector/src/main/java/org/astraea/connector/perf/PerfSource.java index c3063b239f..919330be7c 100644 --- a/connector/src/main/java/org/astraea/connector/perf/PerfSource.java +++ b/connector/src/main/java/org/astraea/connector/perf/PerfSource.java @@ -166,7 +166,7 @@ protected List takeConfiguration(int maxTasks) { copy.put(SourceConnector.TOPICS_KEY, t); return new Configuration(copy); }) - .collect(Collectors.toUnmodifiableList()); + .toList(); return Utils.chunk(topics, maxTasks).stream() .map( tps -> { @@ -174,7 +174,7 @@ protected List takeConfiguration(int maxTasks) { copy.put(SourceConnector.TOPICS_KEY, String.join(",", tps)); return new Configuration(copy); }) - .collect(Collectors.toUnmodifiableList()); + .toList(); } @Override @@ -243,13 +243,11 @@ protected void init(Configuration configuration, MetadataStorage storage) { RecordGenerator.builder() .batchSize(batchSize) .keyTableSeed(keyTableSeed) - .keyRange( - LongStream.rangeClosed(0, 10000).boxed().collect(Collectors.toUnmodifiableList())) + .keyRange(LongStream.rangeClosed(0, 10000).boxed().toList()) .keyDistribution(keyDistribution.create(10000, configuration)) .keySizeDistribution(keySizeDistribution.create((int) KeySize.bytes(), configuration)) .valueTableSeed(valueTableSeed) - .valueRange( - LongStream.rangeClosed(0, 10000).boxed().collect(Collectors.toUnmodifiableList())) + .valueRange(LongStream.rangeClosed(0, 10000).boxed().toList()) .valueDistribution(valueDistribution.create(10000, configuration)) .valueSizeDistribution( valueSizeDistribution.create((int) valueSize.bytes(), configuration))