Skip to content

Commit

Permalink
style: Minor optimization and code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jruaux committed Jul 12, 2023
1 parent cf0447a commit 2804c22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions plugins/riot/src/main/java/com/redis/riot/cli/Ping.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.springframework.batch.core.step.tasklet.TaskletStep;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.util.Assert;
import org.threeten.bp.Duration;

import com.redis.lettucemod.api.StatefulRedisModulesConnection;
import com.redis.lettucemod.util.RedisModulesUtils;
Expand Down Expand Up @@ -64,7 +63,7 @@ public PingTask(CommandContext context, PingOptions options) {
@Override
public RepeatStatus call() throws Exception {
if (iteration.get() > 0 && jobOptions.getSleep() > 0) {
Thread.sleep(Duration.ofSeconds(jobOptions.getSleep()).toMillis());
Thread.sleep(jobOptions.getSleep());
}
try (StatefulRedisModulesConnection<String, String> connection = RedisModulesUtils
.connection(context.getRedisClient())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@

public class RedisReaderOptions {

@Option(names = "--read-queue", description = "Capacity of the reader queue (default: ${DEFAULT-VALUE}).", paramLabel = "<int>")
private int queueCapacity = QueueOptions.DEFAULT_CAPACITY;

@Option(names = "--read-threads", description = "Number of reader threads (default: ${DEFAULT-VALUE}).", paramLabel = "<int>")
private int threads = ReaderOptions.DEFAULT_THREADS;

@Option(names = "--read-batch", description = "Number of reader values to process at once (default: ${DEFAULT-VALUE}).", paramLabel = "<int>")
private int chunkSize = ReaderOptions.DEFAULT_CHUNK_SIZE;

@Option(names = "--scan-match", description = "SCAN MATCH pattern (default: ${DEFAULT-VALUE}).", paramLabel = "<glob>")
private String scanMatch = ScanOptions.DEFAULT_MATCH;

Expand All @@ -36,6 +27,15 @@ public class RedisReaderOptions {
@Option(names = "--scan-type", description = "SCAN TYPE option.", paramLabel = "<type>")
private Optional<String> scanType = Optional.empty();

@Option(names = "--read-queue", description = "Capacity of the reader queue (default: ${DEFAULT-VALUE}).", paramLabel = "<int>")
private int queueCapacity = QueueOptions.DEFAULT_CAPACITY;

@Option(names = "--read-threads", description = "Number of reader threads (default: ${DEFAULT-VALUE}).", paramLabel = "<int>")
private int threads = ReaderOptions.DEFAULT_THREADS;

@Option(names = "--read-batch", description = "Number of reader values to process at once (default: ${DEFAULT-VALUE}).", paramLabel = "<int>")
private int chunkSize = ReaderOptions.DEFAULT_CHUNK_SIZE;

@Option(names = "--read-pool", description = "Max connections for reader pool (default: ${DEFAULT-VALUE}).", paramLabel = "<int>")
private int poolMaxTotal = PoolOptions.DEFAULT_MAX_TOTAL;

Expand Down

0 comments on commit 2804c22

Please sign in to comment.