Skip to content

Commit

Permalink
[CONNECTOR] rewrite PerfSource by java17 toList #1776
Browse files Browse the repository at this point in the history
  • Loading branch information
Haser0305 authored May 26, 2023
1 parent ced840f commit 6e6bafb
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ protected List<Configuration> 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 -> {
var copy = new HashMap<>(config.raw());
copy.put(SourceConnector.TOPICS_KEY, String.join(",", tps));
return new Configuration(copy);
})
.collect(Collectors.toUnmodifiableList());
.toList();
}

@Override
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 6e6bafb

Please sign in to comment.