Skip to content

Commit 381ec4f

Browse files
author
Ubuntu
committed
Rewrite the Options class using a record
1 parent cbb2a9c commit 381ec4f

File tree

1 file changed

+6
-44
lines changed

1 file changed

+6
-44
lines changed

jmh-benchmarks/src/main/java/org/apache/kafka/jmh/log/TestLinearWriteSpeed.java

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -283,50 +283,12 @@ public void close() throws IOException {
283283
}
284284
}
285285

286-
private static class Options {
287-
private final OptionSpec<String> dirOpt;
288-
private final OptionSpec<Long> bytesOpt;
289-
private final OptionSpec<Integer> sizeOpt;
290-
private final OptionSpec<Integer> messageSizeOpt;
291-
private final OptionSpec<Integer> filesOpt;
292-
private final OptionSpec<Long> reportingIntervalOpt;
293-
private final OptionSpec<Integer> maxThroughputOpt;
294-
private final OptionSpec<Long> flushIntervalOpt;
295-
private final OptionSpec<String> compressionCodecOpt;
296-
private final OptionSpec<Integer> compressionLevelOpt;
297-
private final OptionSpec<Void> channelOpt;
298-
private final OptionSpec<Void> logOpt;
299-
private final OptionSpec<Void> mmapOpt;
300-
301-
private Options(
302-
OptionSpec<String> dirOpt,
303-
OptionSpec<Long> bytesOpt,
304-
OptionSpec<Integer> sizeOpt,
305-
OptionSpec<Integer> messageSizeOpt,
306-
OptionSpec<Integer> filesOpt,
307-
OptionSpec<Long> reportingIntervalOpt,
308-
OptionSpec<Integer> maxThroughputOpt,
309-
OptionSpec<Long> flushIntervalOpt,
310-
OptionSpec<String> compressionCodecOpt,
311-
OptionSpec<Integer> compressionLevelOpt,
312-
OptionSpec<Void> channelOpt,
313-
OptionSpec<Void> logOpt,
314-
OptionSpec<Void> mmapOpt
315-
) {
316-
this.dirOpt = dirOpt;
317-
this.bytesOpt = bytesOpt;
318-
this.sizeOpt = sizeOpt;
319-
this.messageSizeOpt = messageSizeOpt;
320-
this.filesOpt = filesOpt;
321-
this.reportingIntervalOpt = reportingIntervalOpt;
322-
this.maxThroughputOpt = maxThroughputOpt;
323-
this.flushIntervalOpt = flushIntervalOpt;
324-
this.compressionCodecOpt = compressionCodecOpt;
325-
this.compressionLevelOpt = compressionLevelOpt;
326-
this.channelOpt = channelOpt;
327-
this.logOpt = logOpt;
328-
this.mmapOpt = mmapOpt;
329-
}
286+
private record Options(OptionSpec<String> dirOpt, OptionSpec<Long> bytesOpt, OptionSpec<Integer> sizeOpt,
287+
OptionSpec<Integer> messageSizeOpt, OptionSpec<Integer> filesOpt,
288+
OptionSpec<Long> reportingIntervalOpt, OptionSpec<Integer> maxThroughputOpt,
289+
OptionSpec<Long> flushIntervalOpt, OptionSpec<String> compressionCodecOpt,
290+
OptionSpec<Integer> compressionLevelOpt, OptionSpec<Void> channelOpt,
291+
OptionSpec<Void> logOpt, OptionSpec<Void> mmapOpt) {
330292
}
331293

332294
private static Options createOptions(OptionParser parser) {

0 commit comments

Comments
 (0)