From 4117580081035a9ef7599c4162d4a585b1bca40e Mon Sep 17 00:00:00 2001 From: acarbonetto Date: Tue, 10 Oct 2023 08:39:15 -0700 Subject: [PATCH] Spotless apply Signed-off-by: acarbonetto --- .../benchmarks/BenchmarkingApp.java | 7 +++-- .../benchmarks/clients/AsyncClient.java | 6 ++--- .../benchmarks/clients/Client.java | 6 ++--- .../clients/LettuceAsyncClient.java | 5 +--- .../benchmarks/clients/LettuceClient.java | 7 ++--- .../benchmarks/clients/SyncClient.java | 6 ++--- .../benchmarks/utils/Benchmarking.java | 26 +++++++++---------- .../benchmarks/utils/ChosenAction.java | 6 ++--- .../benchmarks/utils/ConnectionSettings.java | 6 ++--- .../benchmarks/utils/LatencyResults.java | 6 ++--- 10 files changed, 30 insertions(+), 51 deletions(-) diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java b/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java index d27acecc5c..6bc2aede9f 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java @@ -9,7 +9,6 @@ import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; -import javababushka.benchmarks.clients.LettuceClient; import javababushka.benchmarks.clients.LettuceAsyncClient; import javababushka.benchmarks.clients.LettuceClient; import org.apache.commons.cli.CommandLine; @@ -228,8 +227,8 @@ public RunConfiguration() { concurrentTasks = List.of(10, 100); clients = new ClientName[] { - // ClientName.BABUSHKA, - ClientName.JEDIS, ClientName.JEDIS_ASYNC, ClientName.LETTUCE, ClientName.LETTUCE_ASYNC + // ClientName.BABUSHKA, + ClientName.JEDIS, ClientName.JEDIS_ASYNC, ClientName.LETTUCE, ClientName.LETTUCE_ASYNC }; host = "localhost"; port = 6379; @@ -237,4 +236,4 @@ public RunConfiguration() { tls = false; } } -} \ No newline at end of file +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/AsyncClient.java b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/AsyncClient.java index 6413829eab..f35a233cfa 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/AsyncClient.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/AsyncClient.java @@ -2,9 +2,7 @@ import java.util.concurrent.Future; -/** - * A Redis client with async capabilities - */ +/** A Redis client with async capabilities */ public interface AsyncClient extends Client { long DEFAULT_TIMEOUT = 1000; @@ -16,4 +14,4 @@ public interface AsyncClient extends Client { T waitForResult(Future future); T waitForResult(Future future, long timeout); -} \ No newline at end of file +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/Client.java b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/Client.java index a3376ccbec..d95f31f25d 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/Client.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/Client.java @@ -2,9 +2,7 @@ import javababushka.benchmarks.utils.ConnectionSettings; -/** - * A Redis client interface - */ +/** A Redis client interface */ public interface Client { void connectToRedis(); @@ -13,4 +11,4 @@ public interface Client { default void closeConnection() {} String getName(); -} \ No newline at end of file +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/LettuceAsyncClient.java b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/LettuceAsyncClient.java index 40cfd50543..7251953845 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/LettuceAsyncClient.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/LettuceAsyncClient.java @@ -8,10 +8,7 @@ import java.util.concurrent.TimeUnit; import javababushka.benchmarks.utils.ConnectionSettings; -/** - * A Lettuce client with async capabilities - * see: https://lettuce.io/ - */ +/** A Lettuce client with async capabilities see: https://lettuce.io/ */ public class LettuceAsyncClient implements AsyncClient { RedisClient client; diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/LettuceClient.java b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/LettuceClient.java index 0ce80fac0f..674fb729b0 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/LettuceClient.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/LettuceClient.java @@ -5,10 +5,7 @@ import io.lettuce.core.api.sync.RedisStringCommands; import javababushka.benchmarks.utils.ConnectionSettings; -/** - * A Lettuce client with sync capabilities - * see: https://lettuce.io/ - */ +/** A Lettuce client with sync capabilities see: https://lettuce.io/ */ public class LettuceClient implements SyncClient { RedisClient client; @@ -53,4 +50,4 @@ public void closeConnection() { public String getName() { return "Lettuce"; } -} \ No newline at end of file +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/SyncClient.java b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/SyncClient.java index fa9ebd397e..603f91e936 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/clients/SyncClient.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/clients/SyncClient.java @@ -1,10 +1,8 @@ package javababushka.benchmarks.clients; -/** - * A Redis client with sync capabilities - */ +/** A Redis client with sync capabilities */ public interface SyncClient extends Client { void set(String key, String value); String get(String key); -} \ No newline at end of file +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/Benchmarking.java b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/Benchmarking.java index b73394a3eb..6956944fd0 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/Benchmarking.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/Benchmarking.java @@ -13,16 +13,14 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; import java.util.stream.Collectors; -import javababushka.benchmarks.clients.AsyncClient; import javababushka.benchmarks.BenchmarkingApp; +import javababushka.benchmarks.clients.AsyncClient; import javababushka.benchmarks.clients.Client; import javababushka.benchmarks.clients.SyncClient; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.tuple.Pair; -/** - * Class to calculate latency on client-actions - */ +/** Class to calculate latency on client-actions */ public class Benchmarking { static final double PROB_GET = 0.8; static final double PROB_GET_EXISTING_KEY = 0.8; @@ -234,27 +232,27 @@ public static Pair measurePerformance( ChosenAction.GET_EXISTING, async ? () -> - ((AsyncClient) client) - .asyncGet(generateKeySet()) - .get(ASYNC_OPERATION_TIMEOUT_SEC, TimeUnit.SECONDS) + ((AsyncClient) client) + .asyncGet(generateKeySet()) + .get(ASYNC_OPERATION_TIMEOUT_SEC, TimeUnit.SECONDS) : () -> ((SyncClient) client).get(generateKeySet())); actions.put( ChosenAction.GET_NON_EXISTING, async ? () -> - ((AsyncClient) client) - .asyncGet(generateKeyGet()) - .get(ASYNC_OPERATION_TIMEOUT_SEC, TimeUnit.SECONDS) + ((AsyncClient) client) + .asyncGet(generateKeyGet()) + .get(ASYNC_OPERATION_TIMEOUT_SEC, TimeUnit.SECONDS) : () -> ((SyncClient) client).get(generateKeyGet())); actions.put( ChosenAction.SET, async ? () -> - ((AsyncClient) client) - .asyncSet(generateKeySet(), value) - .get(ASYNC_OPERATION_TIMEOUT_SEC, TimeUnit.SECONDS) + ((AsyncClient) client) + .asyncSet(generateKeySet(), value) + .get(ASYNC_OPERATION_TIMEOUT_SEC, TimeUnit.SECONDS) : () -> ((SyncClient) client).set(generateKeySet(), value)); return getLatency(actions); } -} \ No newline at end of file +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/ChosenAction.java b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/ChosenAction.java index 3cc685139e..b6bfe118ee 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/ChosenAction.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/ChosenAction.java @@ -1,10 +1,8 @@ package javababushka.benchmarks.utils; -/** - * enum for actions - */ +/** enum for actions */ public enum ChosenAction { GET_NON_EXISTING, GET_EXISTING, SET -} \ No newline at end of file +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/ConnectionSettings.java b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/ConnectionSettings.java index f1aee3d06a..1866908835 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/ConnectionSettings.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/ConnectionSettings.java @@ -1,8 +1,6 @@ package javababushka.benchmarks.utils; -/** - * Redis-client settings - */ +/** Redis-client settings */ public class ConnectionSettings { public String host; public int port; @@ -13,4 +11,4 @@ public ConnectionSettings(String host, int port, boolean useSsl) { this.port = port; this.useSsl = useSsl; } -} \ No newline at end of file +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/LatencyResults.java b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/LatencyResults.java index 054623b8f0..4f62f840c0 100644 --- a/java/benchmarks/src/main/java/javababushka/benchmarks/utils/LatencyResults.java +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/utils/LatencyResults.java @@ -1,8 +1,6 @@ package javababushka.benchmarks.utils; -/** - * Raw timing results in nanoseconds - */ +/** Raw timing results in nanoseconds */ public class LatencyResults { public final double avgLatency; public final long p50Latency; @@ -18,4 +16,4 @@ public LatencyResults( this.p99Latency = p99Latency; this.stdDeviation = stdDeviation; } -} \ No newline at end of file +}