From f19a61452ae71cdb2d5c8ea82087e52c6b025e10 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 10 Mar 2022 10:43:30 +0100 Subject: [PATCH] Polishing. Update since tags. Move FlushOption converters to client-specific converters. Use method-references where possible. See #2187 Original pull request: #2190. --- .../ReactiveClusterServerCommands.java | 8 ++--- .../connection/ReactiveServerCommands.java | 8 ++--- .../RedisClusterServerCommands.java | 4 +-- .../redis/connection/RedisServerCommands.java | 10 +++--- .../jedis/JedisClusterServerCommands.java | 34 ++++++------------- .../connection/jedis/JedisConverters.java | 24 +++++++++++-- .../connection/jedis/JedisServerCommands.java | 13 +++---- .../lettuce/LettuceClusterServerCommands.java | 8 ++--- .../connection/lettuce/LettuceConverters.java | 21 ++++++++++-- .../LettuceReactiveClusterServerCommands.java | 4 +-- .../LettuceReactiveServerCommands.java | 4 +-- .../lettuce/LettuceServerCommands.java | 20 ++--------- .../data/redis/core/ClusterOperations.java | 6 ++-- .../redis/core/DefaultClusterOperations.java | 26 +++++++------- ...eactiveServerCommandsIntegrationTests.java | 5 --- 15 files changed, 96 insertions(+), 99 deletions(-) diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveClusterServerCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveClusterServerCommands.java index 40d497d98..84bbfe332 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveClusterServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveClusterServerCommands.java @@ -94,13 +94,13 @@ public interface ReactiveClusterServerCommands extends ReactiveServerCommands { Mono flushDb(RedisClusterNode node); /** - * Delete all keys of the currently selected database using the specified flush option. + * Delete all keys of the currently selected database using the specified {@link FlushOption}. * * @param node must not be {@literal null}. {@link Mono} indicating command completion. * @param option * @throws IllegalArgumentException when {@code node} is {@literal null}. * @see RedisServerCommands#flushDb(FlushOption) - * @since 2.6 + * @since 2.7 */ Mono flushDb(RedisClusterNode node, FlushOption option); @@ -115,14 +115,14 @@ public interface ReactiveClusterServerCommands extends ReactiveServerCommands { Mono flushAll(RedisClusterNode node); /** - * Delete all all keys from all databases using the specified flush option. + * Delete all all keys from all databases using the specified {@link FlushOption}. * * @param node must not be {@literal null}. * @param option * @return {@link Mono} indicating command completion. * @throws IllegalArgumentException when {@code node} is {@literal null}. * @see RedisServerCommands#flushAll(FlushOption) - * @since 2.6 + * @since 2.7 */ Mono flushAll(RedisClusterNode node, FlushOption option); diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveServerCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveServerCommands.java index c1f8c9a90..17f206b9f 100644 --- a/src/main/java/org/springframework/data/redis/connection/ReactiveServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/ReactiveServerCommands.java @@ -84,12 +84,12 @@ public interface ReactiveServerCommands { Mono flushDb(); /** - * Delete all keys of the currently selected database using the specified flush option. + * Delete all keys of the currently selected database using the specified {@link FlushOption}. * * @param option * @return {@link Mono} indicating command completion. * @see Redis Documentation: FLUSHDB - * @since 2.6 + * @since 2.7 */ Mono flushDb(FlushOption option); @@ -102,12 +102,12 @@ public interface ReactiveServerCommands { Mono flushAll(); /** - * Delete all all keys from all databases using the specified flush option. + * Delete all all keys from all databases using the specified {@link FlushOption}. * * @param option * @return {@link Mono} indicating command completion. * @see Redis Documentation: FLUSHALL - * @since 2.6 + * @since 2.7 */ Mono flushAll(FlushOption option); diff --git a/src/main/java/org/springframework/data/redis/connection/RedisClusterServerCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisClusterServerCommands.java index 362d044ce..8e57ce75e 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisClusterServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisClusterServerCommands.java @@ -70,7 +70,7 @@ public interface RedisClusterServerCommands extends RedisServerCommands { * @param node must not be {@literal null}. * @param option * @see RedisServerCommands#flushDb(FlushOption) - * @since 2.6 + * @since 2.7 */ void flushDb(RedisClusterNode node, FlushOption option); @@ -84,7 +84,7 @@ public interface RedisClusterServerCommands extends RedisServerCommands { * @param node must not be {@literal null}. * @param option * @see RedisServerCommands#flushAll(FlushOption) - * @since 2.6 + * @since 2.7 */ void flushAll(RedisClusterNode node, FlushOption option); diff --git a/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java index 86686f33f..241158b1e 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisServerCommands.java @@ -45,7 +45,7 @@ public interface RedisServerCommands { } /** - * @since 2.6 + * @since 2.7 */ enum FlushOption { SYNC, ASYNC @@ -110,11 +110,11 @@ public interface RedisServerCommands { void flushDb(); /** - * Delete all keys of the currently selected database using the specified flush option. + * Delete all keys of the currently selected database using the specified {@link FlushOption}. * * @param option * @see Redis Documentation: FLUSHDB - * @since 2.6 + * @since 2.7 */ void flushDb(FlushOption option); @@ -126,11 +126,11 @@ public interface RedisServerCommands { void flushAll(); /** - * Delete all all keys from all databases using the specified flush option. + * Delete all all keys from all databases using the specified {@link FlushOption}. * * @param option * @see Redis Documentation: FLUSHALL - * @since 2.6 + * @since 2.7 */ void flushAll(FlushOption option); diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterServerCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterServerCommands.java index 0c92c51ca..5b0a38cfe 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterServerCommands.java @@ -17,7 +17,6 @@ package org.springframework.data.redis.connection.jedis; import redis.clients.jedis.BinaryJedis; import redis.clients.jedis.Jedis; -import redis.clients.jedis.args.FlushMode; import java.util.ArrayList; import java.util.Collection; @@ -131,7 +130,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void flushDb(FlushOption option) { - executeCommandOnAllNodes(it -> it.flushDB(toFlushMode(option))); + executeCommandOnAllNodes(it -> it.flushDB(JedisConverters.toFlushMode(option))); } @Override @@ -141,7 +140,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void flushDb(RedisClusterNode node, FlushOption option) { - executeCommandOnSingleNode(it -> it.flushDB(toFlushMode(option)), node); + executeCommandOnSingleNode(it -> it.flushDB(JedisConverters.toFlushMode(option)), node); } @Override @@ -153,7 +152,8 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void flushAll(FlushOption option) { connection.getClusterCommandExecutor() - .executeCommandOnAllNodes((JedisClusterCommandCallback) it -> it.flushAll(toFlushMode(option))); + .executeCommandOnAllNodes( + (JedisClusterCommandCallback) it -> it.flushAll(JedisConverters.toFlushMode(option))); } @Override @@ -163,7 +163,7 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public void flushAll(RedisClusterNode node, FlushOption option) { - executeCommandOnSingleNode(it -> it.flushAll(toFlushMode(option)), node); + executeCommandOnSingleNode(it -> it.flushAll(JedisConverters.toFlushMode(option)), node); } @Override @@ -319,16 +319,18 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { @Override public Long time(TimeUnit timeUnit) { - return convertListOfStringToTime(connection.getClusterCommandExecutor() - .executeCommandOnArbitraryNode((JedisClusterCommandCallback>) BinaryJedis::time).getValue(), + return convertListOfStringToTime( + connection.getClusterCommandExecutor() + .executeCommandOnArbitraryNode((JedisClusterCommandCallback>) BinaryJedis::time).getValue(), timeUnit); } @Override public Long time(RedisClusterNode node, TimeUnit timeUnit) { - return convertListOfStringToTime(connection.getClusterCommandExecutor() - .executeCommandOnSingleNode((JedisClusterCommandCallback>) BinaryJedis::time, node).getValue(), + return convertListOfStringToTime( + connection.getClusterCommandExecutor() + .executeCommandOnSingleNode((JedisClusterCommandCallback>) BinaryJedis::time, node).getValue(), timeUnit); } @@ -419,18 +421,4 @@ class JedisClusterServerCommands implements RedisClusterServerCommands { return connection.getClusterCommandExecutor().executeCommandOnAllNodes(cmd); } - static FlushMode toFlushMode(@Nullable FlushOption option) { - - if (option == null) { - return FlushMode.SYNC; - } - - switch (option) { - case ASYNC: - return FlushMode.ASYNC; - case SYNC: - return FlushMode.SYNC; - } - throw new UnsupportedOperationException("Flush option " + option + " is not implemented."); - } } diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java index bfd7b6d6f..004d604ec 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java @@ -22,6 +22,7 @@ import redis.clients.jedis.GeoUnit; import redis.clients.jedis.ListPosition; import redis.clients.jedis.ScanParams; import redis.clients.jedis.SortingParams; +import redis.clients.jedis.args.FlushMode; import redis.clients.jedis.params.GeoRadiusParam; import redis.clients.jedis.params.GetExParams; import redis.clients.jedis.params.SetParams; @@ -59,6 +60,7 @@ import org.springframework.data.redis.connection.RedisGeoCommands.GeoRadiusComma import org.springframework.data.redis.connection.RedisGeoCommands.GeoRadiusCommandArgs.Flag; import org.springframework.data.redis.connection.RedisListCommands.Position; import org.springframework.data.redis.connection.RedisServer; +import org.springframework.data.redis.connection.RedisServerCommands; import org.springframework.data.redis.connection.RedisStringCommands.BitOperation; import org.springframework.data.redis.connection.RedisStringCommands.SetOption; import org.springframework.data.redis.connection.RedisZSetCommands.Range.Boundary; @@ -436,10 +438,12 @@ public abstract class JedisConverters extends Converters { } if (expiration.getTimeUnit() == TimeUnit.MILLISECONDS) { - return expiration.isUnixTimestamp() ? paramsToUse.pxAt(expiration.getExpirationTime()) : paramsToUse.px(expiration.getExpirationTime()); + return expiration.isUnixTimestamp() ? paramsToUse.pxAt(expiration.getExpirationTime()) + : paramsToUse.px(expiration.getExpirationTime()); } - return expiration.isUnixTimestamp() ? paramsToUse.exAt(expiration.getConverted(TimeUnit.SECONDS)) : paramsToUse.ex(expiration.getConverted(TimeUnit.SECONDS)); + return expiration.isUnixTimestamp() ? paramsToUse.exAt(expiration.getConverted(TimeUnit.SECONDS)) + : paramsToUse.ex(expiration.getConverted(TimeUnit.SECONDS)); } /** @@ -814,6 +818,22 @@ public abstract class JedisConverters extends Converters { return args.toArray(new byte[0][0]); } + static FlushMode toFlushMode(@Nullable RedisServerCommands.FlushOption option) { + + if (option == null) { + return FlushMode.SYNC; + } + + switch (option) { + case ASYNC: + return FlushMode.ASYNC; + case SYNC: + return FlushMode.SYNC; + default: + throw new IllegalArgumentException("Flush option " + option + " is not supported."); + } + } + /** * @author Christoph Strobl * @since 1.8 diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisServerCommands.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisServerCommands.java index f5f576020..4425ab6db 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisServerCommands.java @@ -18,7 +18,6 @@ package org.springframework.data.redis.connection.jedis; import redis.clients.jedis.BinaryJedis; import redis.clients.jedis.Jedis; import redis.clients.jedis.MultiKeyPipelineBase; -import redis.clients.jedis.args.FlushMode; import redis.clients.jedis.args.SaveMode; import java.util.List; @@ -39,8 +38,6 @@ import org.springframework.util.Assert; */ class JedisServerCommands implements RedisServerCommands { - private static final String SHUTDOWN_SCRIPT = "return redis.call('SHUTDOWN','%s')"; - private final JedisConnection connection; JedisServerCommands(JedisConnection connection) { @@ -79,9 +76,8 @@ class JedisServerCommands implements RedisServerCommands { @Override public void flushDb(FlushOption option) { - - FlushMode flushMode = JedisClusterServerCommands.toFlushMode(option); - connection.invokeStatus().just(it -> it.flushDB(flushMode), it -> it.flushDB(flushMode)); + connection.invokeStatus().just(BinaryJedis::flushDB, MultiKeyPipelineBase::flushDB, + JedisConverters.toFlushMode(option)); } @Override @@ -91,9 +87,8 @@ class JedisServerCommands implements RedisServerCommands { @Override public void flushAll(FlushOption option) { - - FlushMode flushMode = JedisClusterServerCommands.toFlushMode(option); - connection.invokeStatus().just(it -> it.flushAll(flushMode), it -> it.flushAll(flushMode)); + connection.invokeStatus().just(BinaryJedis::flushAll, MultiKeyPipelineBase::flushAll, + JedisConverters.toFlushMode(option)); } @Override diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterServerCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterServerCommands.java index 5c11e15b8..c76657f0d 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterServerCommands.java @@ -99,7 +99,7 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public void flushDb(FlushOption option) { - executeCommandOnAllNodes(it -> it.flushdb(toFlushMode(option))); + executeCommandOnAllNodes(it -> it.flushdb(LettuceConverters.toFlushMode(option))); } @Override @@ -109,7 +109,7 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public void flushDb(RedisClusterNode node, FlushOption option) { - executeCommandOnSingleNode(it -> it.flushdb(toFlushMode(option)), node); + executeCommandOnSingleNode(it -> it.flushdb(LettuceConverters.toFlushMode(option)), node); } @Override @@ -119,7 +119,7 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public void flushAll(FlushOption option) { - executeCommandOnAllNodes(it -> it.flushall(toFlushMode(option))); + executeCommandOnAllNodes(it -> it.flushall(LettuceConverters.toFlushMode(option))); } @Override @@ -129,7 +129,7 @@ class LettuceClusterServerCommands extends LettuceServerCommands implements Redi @Override public void flushAll(RedisClusterNode node, FlushOption option) { - executeCommandOnSingleNode(it -> it.flushall(toFlushMode(option)), node); + executeCommandOnSingleNode(it -> it.flushall(LettuceConverters.toFlushMode(option)), node); } @Override diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java index f54c3f3a0..47b1b02c5 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java @@ -896,10 +896,9 @@ public abstract class LettuceConverters extends Converters { if (args.hasFlags()) { for (GeoCommandArgs.GeoCommandFlag flag : args.getFlags()) { - if(flag.equals(GeoRadiusCommandArgs.Flag.WITHCOORD)) { + if (flag.equals(GeoRadiusCommandArgs.Flag.WITHCOORD)) { geoArgs.withCoordinates(); - } - else if(flag.equals(GeoRadiusCommandArgs.Flag.WITHDIST)) { + } else if (flag.equals(GeoRadiusCommandArgs.Flag.WITHDIST)) { geoArgs.withDistance(); } } @@ -1171,6 +1170,22 @@ public abstract class LettuceConverters extends Converters { throw new IllegalArgumentException(String.format("Cannot convert %s to Lettuce GeoRef", reference)); } + static FlushMode toFlushMode(@Nullable RedisServerCommands.FlushOption option) { + + if (option == null) { + return FlushMode.SYNC; + } + + switch (option) { + case ASYNC: + return FlushMode.ASYNC; + case SYNC: + return FlushMode.SYNC; + default: + throw new IllegalArgumentException("Flush option " + option + " is not supported."); + } + } + /** * @author Christoph Strobl * @since 1.8 diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterServerCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterServerCommands.java index 4cd684c94..682dfaf30 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveClusterServerCommands.java @@ -109,7 +109,7 @@ class LettuceReactiveClusterServerCommands extends LettuceReactiveServerCommands @Override public Mono flushDb(RedisClusterNode node, FlushOption option) { - return connection.execute(node, it -> it.flushdb(LettuceServerCommands.toFlushMode(option))).next(); + return connection.execute(node, it -> it.flushdb(LettuceConverters.toFlushMode(option))).next(); } @Override @@ -119,7 +119,7 @@ class LettuceReactiveClusterServerCommands extends LettuceReactiveServerCommands @Override public Mono flushAll(RedisClusterNode node, FlushOption option) { - return connection.execute(node, it -> it.flushall(LettuceServerCommands.toFlushMode(option))).next(); + return connection.execute(node, it -> it.flushall(LettuceConverters.toFlushMode(option))).next(); } @Override diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommands.java index 283f4bc9c..110661615 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommands.java @@ -86,7 +86,7 @@ class LettuceReactiveServerCommands implements ReactiveServerCommands { @Override public Mono flushDb(FlushOption option) { - return connection.execute(it -> it.flushdb(LettuceServerCommands.toFlushMode(option))).next(); + return connection.execute(it -> it.flushdb(LettuceConverters.toFlushMode(option))).next(); } @Override @@ -96,7 +96,7 @@ class LettuceReactiveServerCommands implements ReactiveServerCommands { @Override public Mono flushAll(FlushOption option) { - return connection.execute(it -> it.flushall(LettuceServerCommands.toFlushMode(option))).next(); + return connection.execute(it -> it.flushall(LettuceConverters.toFlushMode(option))).next(); } @Override diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceServerCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceServerCommands.java index a9112844c..7779771e0 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceServerCommands.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceServerCommands.java @@ -15,7 +15,6 @@ */ package org.springframework.data.redis.connection.lettuce; -import io.lettuce.core.FlushMode; import io.lettuce.core.LettuceFutures; import io.lettuce.core.RedisFuture; import io.lettuce.core.api.async.RedisKeyAsyncCommands; @@ -78,7 +77,7 @@ class LettuceServerCommands implements RedisServerCommands { @Override public void flushDb(FlushOption option) { - connection.invoke().just(it -> it.flushdb(toFlushMode(option))); + connection.invokeStatus().just(RedisServerAsyncCommands::flushdb, LettuceConverters.toFlushMode(option)); } @Override @@ -88,7 +87,7 @@ class LettuceServerCommands implements RedisServerCommands { @Override public void flushAll(FlushOption option) { - connection.invokeStatus().just(it -> it.flushall(toFlushMode(option))); + connection.invokeStatus().just(RedisServerAsyncCommands::flushall, LettuceConverters.toFlushMode(option)); } @Override @@ -233,21 +232,6 @@ class LettuceServerCommands implements RedisServerCommands { return connection.getConnection(); } - static FlushMode toFlushMode(@Nullable FlushOption option) { - - if (option == null) { - return FlushMode.SYNC; - } - - switch (option) { - case ASYNC: - return FlushMode.ASYNC; - case SYNC: - return FlushMode.SYNC; - } - throw new UnsupportedOperationException("Flush option " + option + " is not implemented."); - } - static class CompletedRedisFuture extends CompletableFuture implements RedisFuture { public CompletedRedisFuture(T value) { diff --git a/src/main/java/org/springframework/data/redis/core/ClusterOperations.java b/src/main/java/org/springframework/data/redis/core/ClusterOperations.java index 64396b55e..aa0210f56 100644 --- a/src/main/java/org/springframework/data/redis/core/ClusterOperations.java +++ b/src/main/java/org/springframework/data/redis/core/ClusterOperations.java @@ -120,12 +120,12 @@ public interface ClusterOperations { void flushDb(RedisClusterNode node); /** - * Flush db on node using the specified flush option. + * Flush db on node using the specified {@link FlushOption}. * * @param node must not be {@literal null}. - * @param option + * @param option must not be {@literal null}. * @see RedisConnection#flushDb(FlushOption) - * @since 2.6 + * @since 2.7 */ void flushDb(RedisClusterNode node, FlushOption option); diff --git a/src/main/java/org/springframework/data/redis/core/DefaultClusterOperations.java b/src/main/java/org/springframework/data/redis/core/DefaultClusterOperations.java index 36ced7401..1309f41a9 100644 --- a/src/main/java/org/springframework/data/redis/core/DefaultClusterOperations.java +++ b/src/main/java/org/springframework/data/redis/core/DefaultClusterOperations.java @@ -53,7 +53,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public Set keys(final RedisClusterNode node, final K pattern) { + public Set keys(RedisClusterNode node, K pattern) { Assert.notNull(node, "ClusterNode must not be null."); @@ -61,7 +61,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public K randomKey(final RedisClusterNode node) { + public K randomKey(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -69,7 +69,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public String ping(final RedisClusterNode node) { + public String ping(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -77,7 +77,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public void addSlots(final RedisClusterNode node, final int... slots) { + public void addSlots(RedisClusterNode node, int... slots) { Assert.notNull(node, "ClusterNode must not be null."); @@ -97,7 +97,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public void bgReWriteAof(final RedisClusterNode node) { + public void bgReWriteAof(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -108,7 +108,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public void bgSave(final RedisClusterNode node) { + public void bgSave(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -119,7 +119,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public void meet(final RedisClusterNode node) { + public void meet(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -130,7 +130,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public void forget(final RedisClusterNode node) { + public void forget(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -141,7 +141,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public void flushDb(final RedisClusterNode node) { + public void flushDb(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -163,7 +163,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public Collection getSlaves(final RedisClusterNode node) { + public Collection getSlaves(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -171,7 +171,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public void save(final RedisClusterNode node) { + public void save(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -182,7 +182,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public void shutdown(final RedisClusterNode node) { + public void shutdown(RedisClusterNode node) { Assert.notNull(node, "ClusterNode must not be null."); @@ -193,7 +193,7 @@ class DefaultClusterOperations extends AbstractOperations implements } @Override - public void reshard(final RedisClusterNode source, final int slot, final RedisClusterNode target) { + public void reshard(RedisClusterNode source, int slot, RedisClusterNode target) { Assert.notNull(source, "Source node must not be null."); Assert.notNull(target, "Target node must not be null."); diff --git a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommandsIntegrationTests.java b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommandsIntegrationTests.java index 5cc6180a7..9d6439e76 100644 --- a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommandsIntegrationTests.java +++ b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveServerCommandsIntegrationTests.java @@ -20,7 +20,6 @@ import static org.assertj.core.api.Assumptions.*; import reactor.test.StepVerifier; -import org.junit.jupiter.api.Disabled; import org.springframework.data.redis.connection.RedisServerCommands.FlushOption; import org.springframework.data.redis.test.extension.parametrized.ParameterizedRedisTest; @@ -73,7 +72,6 @@ public class LettuceReactiveServerCommandsIntegrationTests extends LettuceReacti connection.serverCommands().dbSize().as(StepVerifier::create).expectNext(0L).verifyComplete(); } - @Disabled("Wait for https://github.com/lettuce-io/lettuce-core/pull/1908") @ParameterizedRedisTest // GH-2187 void flushDbSyncShouldRespondCorrectly() { @@ -91,7 +89,6 @@ public class LettuceReactiveServerCommandsIntegrationTests extends LettuceReacti connection.serverCommands().dbSize().as(StepVerifier::create).expectNext(0L).verifyComplete(); } - @Disabled("Wait for https://github.com/lettuce-io/lettuce-core/pull/1908") @ParameterizedRedisTest // GH-2187 void flushDbAsyncShouldRespondCorrectly() { @@ -124,7 +121,6 @@ public class LettuceReactiveServerCommandsIntegrationTests extends LettuceReacti connection.serverCommands().dbSize().as(StepVerifier::create).expectNext(0L).verifyComplete(); } - @Disabled("Wait for https://github.com/lettuce-io/lettuce-core/pull/1908") @ParameterizedRedisTest // GH-2187 void flushAllSyncShouldRespondCorrectly() { @@ -140,7 +136,6 @@ public class LettuceReactiveServerCommandsIntegrationTests extends LettuceReacti connection.serverCommands().dbSize().as(StepVerifier::create).expectNext(0L).verifyComplete(); } - @Disabled("Wait for https://github.com/lettuce-io/lettuce-core/pull/1908") @ParameterizedRedisTest // GH-2187 void flushAllAsyncShouldRespondCorrectly() {