Skip to content

Commit

Permalink
style: fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Ning Yu <ningyu@automq.com>
  • Loading branch information
Chillax-0v0 authored and superhx committed Dec 25, 2024
1 parent 5979da1 commit fc1ea5f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

package org.apache.kafka.tools.automq.perf;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import org.apache.kafka.common.utils.Exit;
import org.apache.kafka.tools.automq.perf.ConsumerService.ConsumersConfig;
import org.apache.kafka.tools.automq.perf.ProducerService.ProducersConfig;
Expand All @@ -29,6 +27,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

import static net.sourceforge.argparse4j.impl.Arguments.storeTrue;
import static org.apache.kafka.tools.automq.perf.PerfConfig.IntegerArgumentType.nonNegativeInteger;
Expand Down Expand Up @@ -312,11 +312,11 @@ private String randomTopicPrefix() {
}

private String randomString(int length) {
final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
final String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
Random r = ThreadLocalRandom.current();
StringBuilder sb = new StringBuilder(length);
for (int i = 0; i < length; i++) {
sb.append(CHARACTERS.charAt(r.nextInt(CHARACTERS.length())));
sb.append(characters.charAt(r.nextInt(characters.length())));
}
return sb.toString();
}
Expand Down

0 comments on commit fc1ea5f

Please sign in to comment.