diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 0000000000..411d4a9338
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,21 @@
+# GitHub Actions for CodeQL Scanning
+
+name: "CodeQL Advanced"
+
+on:
+ push:
+ pull_request:
+ workflow_dispatch:
+ schedule:
+ # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule
+ - cron: '0 5 * * *'
+
+permissions: read-all
+
+jobs:
+ codeql-analysis-call:
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+ uses: spring-io/github-actions/.github/workflows/codeql-analysis.yml@1
diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml
index a5f764579a..4c8108d353 100644
--- a/.github/workflows/project.yml
+++ b/.github/workflows/project.yml
@@ -10,6 +10,11 @@ on:
pull_request_target:
types: [opened, edited, reopened]
+permissions:
+ contents: read
+ issues: write
+ pull-requests: write
+
jobs:
Inbox:
runs-on: ubuntu-latest
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index f15f39b88f..b300b57322 100755
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1,2 +1,2 @@
-#Thu Nov 07 09:47:27 CET 2024
-distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
+#Thu Jul 17 14:00:56 CEST 2025
+distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
diff --git a/Jenkinsfile b/Jenkinsfile
index a4820853f1..c97e40ae1f 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -9,7 +9,7 @@ pipeline {
triggers {
pollSCM 'H/10 * * * *'
- upstream(upstreamProjects: "spring-data-keyvalue/main", threshold: hudson.model.Result.SUCCESS)
+ upstream(upstreamProjects: "spring-data-keyvalue/3.5.x", threshold: hudson.model.Result.SUCCESS)
}
options {
diff --git a/SECURITY.adoc b/SECURITY.adoc
index 884502dfde..654bfbea58 100644
--- a/SECURITY.adoc
+++ b/SECURITY.adoc
@@ -1,9 +1,15 @@
-# Security Policy
+= Security Policy
-## Supported Versions
+== Reporting a Vulnerability
-Please see the https://spring.io/projects/spring-data-redis[Spring Data Redis] project page for supported versions.
+Please, https://github.com/spring-projects/security-advisories/security/advisories/new[open a draft security advisory] if you need to disclose and discuss a security issue in private with the Spring Data team.
+Note that we only accept reports against https://spring.io/projects/spring-data#support[supported versions].
-## Reporting a Vulnerability
+For more details, check out our https://spring.io/security-policy[security policy].
-Please don't raise security vulnerabilities here. Head over to https://pivotal.io/security to learn how to disclose them responsibly.
+== JAR signing
+
+Spring Data JARs released on Maven Central are signed.
+You'll find more information about the key here: https://spring.io/GPG-KEY-spring.txt
+
+Versions released prior to 2023 may be signed with a different key.
diff --git a/ci/pipeline.properties b/ci/pipeline.properties
index 8dd2295acc..d7277c46d4 100644
--- a/ci/pipeline.properties
+++ b/ci/pipeline.properties
@@ -17,8 +17,8 @@ docker.redis.7.version=7.2.4
docker.valkey.8.version=8.1.1
# Docker environment settings
-docker.java.inside.basic=-v $HOME:/tmp/jenkins-home
-docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v $HOME:/tmp/jenkins-home
+docker.java.inside.basic=-v $HOME:/tmp/jenkins-home --ulimit nofile=32000:32000
+docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v $HOME:/tmp/jenkins-home --ulimit nofile=32000:32000
# Credentials
docker.registry=
diff --git a/pom.xml b/pom.xml
index 8c967f3d27..c6a0f9243b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,11 +1,11 @@
-
+
4.0.0org.springframework.dataspring-data-redis
- 3.5.0
+ 3.5.8-SNAPSHOTSpring Data RedisSpring Data module for Redis
@@ -14,12 +14,12 @@
org.springframework.data.buildspring-data-parent
- 3.5.0
+ 3.5.8-SNAPSHOT
- 3.5.0
- 3.5.0
+ 3.5.8-SNAPSHOT
+ 3.5.8-SNAPSHOT1.9.41.4.212.11.1
@@ -388,7 +388,19 @@
-
-
+
+ spring-snapshot
+ https://repo.spring.io/snapshot
+
+ true
+
+
+ false
+
+
+
+ spring-milestone
+ https://repo.spring.io/milestone
+
diff --git a/src/main/antora/modules/ROOT/pages/observability.adoc b/src/main/antora/modules/ROOT/pages/observability.adoc
index e3a43ae122..f7b53ada60 100644
--- a/src/main/antora/modules/ROOT/pages/observability.adoc
+++ b/src/main/antora/modules/ROOT/pages/observability.adoc
@@ -16,7 +16,7 @@ class ObservabilityConfiguration {
public ClientResources clientResources(ObservationRegistry observationRegistry) {
return ClientResources.builder()
- .tracing(new MicrometerTracingAdapter(observationRegistry, "my-redis-cache"))
+ .tracing(new MicrometerTracing(observationRegistry, "my-redis-cache"))
.build();
}
@@ -31,15 +31,20 @@ class ObservabilityConfiguration {
}
----
+NOTE: When using Spring Boot, `LettuceMetricsAutoConfiguration` configures Lettuce's `MicrometerCommandLatencyRecorder`.
+Depending on whether you want only Metrics or Metrics and Tracing, you might want to exclude this auto-configuration class in your application.
+
+NOTE: Use Lettuce's built-in `MicrometerTracing` as `MicrometerTracingAdapter` has been deprecated for removal in future releases.
+
See also https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/database/#redis[OpenTelemetry Semantic Conventions] for further reference.
[[observability-metrics]]
== Observability - Metrics
-Below you can find a list of all metrics declared by this project.
+Below you can find a list of all metrics recorded by `MicrometerTracingAdapter`.
[[observability-metrics-redis-command-observation]]
-== Redis Command Observation
+=== Redis Command Observation
____
Timer created around a Redis command execution.
diff --git a/src/main/antora/modules/ROOT/pages/redis/redis-repositories/expirations.adoc b/src/main/antora/modules/ROOT/pages/redis/redis-repositories/expirations.adoc
index ddb794213d..e037a70c45 100644
--- a/src/main/antora/modules/ROOT/pages/redis/redis-repositories/expirations.adoc
+++ b/src/main/antora/modules/ROOT/pages/redis/redis-repositories/expirations.adoc
@@ -35,7 +35,7 @@ public class TimeToLiveOnMethod {
----
====
-NOTE: Annotating a property explicitly with `@TimeToLive` reads back the actual `TTL` or `PTTL` value from Redis. -1 indicates that the object has no associated expiration.
+NOTE: Annotating a property explicitly with `@TimeToLive` reads back the actual `TTL` or `PTTL` value from Redis. `-1` indicates that the object has no associated expiration.
The repository implementation ensures subscription to https://redis.io/topics/notifications[Redis keyspace notifications] via javadoc:org.springframework.data.redis.listener.RedisMessageListenerContainer[].
@@ -60,8 +60,10 @@ Note that `CONFIG` is disabled on AWS ElastiCache, and enabling the listener lea
To work around this behavior, set the `keyspaceNotificationsConfigParameter` parameter to an empty string.
This prevents `CONFIG` command usage.
-NOTE: Redis Pub/Sub messages are not persistent.
+NOTE: Redis repositories rely on Pub/Sub messages for residual index cleanup.
+Redis Pub/Sub messages are not persistent.
If a key expires while the application is down, the expiry event is not processed, which may lead to secondary indexes containing references to the expired object.
+Redis does not allow for expiration of individual entries of a set that is used as secondary index.
NOTE: `@EnableKeyspaceEvents(shadowCopy = OFF)` disable storage of phantom copies and reduces data size within Redis. `RedisKeyExpiredEvent` will only contain the `id` of the expired key.
diff --git a/src/main/antora/modules/ROOT/pages/redis/redis-repositories/mapping.adoc b/src/main/antora/modules/ROOT/pages/redis/redis-repositories/mapping.adoc
index fb1a08c0f8..166786b1d0 100644
--- a/src/main/antora/modules/ROOT/pages/redis/redis-repositories/mapping.adoc
+++ b/src/main/antora/modules/ROOT/pages/redis/redis-repositories/mapping.adoc
@@ -183,7 +183,7 @@ NOTE: Custom conversions have no effect on index resolution. xref:redis/redis-re
== Customizing Type Mapping
If you want to avoid writing the entire Java class name as type information and would rather like to use a key, you can use the `@TypeAlias` annotation on the entity class being persisted.
-If you need to customize the mapping even more, look at the https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/convert/TypeInformationMapper.html[`TypeInformationMapper`] interface.
+If you need to customize the mapping even more, look at the {spring-data-commons-javadoc-base}/org/springframework/data/convert/TypeInformationMapper.html[`TypeInformationMapper`] interface.
An instance of that interface can be configured at the `DefaultRedisTypeMapper`, which can be configured on `MappingRedisConverter`.
The following example shows how to define a type alias for an entity:
diff --git a/src/main/antora/resources/antora-resources/antora.yml b/src/main/antora/resources/antora-resources/antora.yml
index 10dd13d032..a42895b13e 100644
--- a/src/main/antora/resources/antora-resources/antora.yml
+++ b/src/main/antora/resources/antora-resources/antora.yml
@@ -3,21 +3,22 @@ prerelease: ${antora-component.prerelease}
asciidoc:
attributes:
- copyright-year: ${current.year}
- version: ${project.version}
- springversionshort: ${spring.short}
- springversion: ${spring}
attribute-missing: 'warn'
- commons: ${springdata.commons.docs}
- lettuce: ${lettuce}
- jedis: ${jedis}
+ chomp: 'all'
+ version: '${project.version}'
+ copyright-year: '${current.year}'
+ springversionshort: '${spring.short}'
+ springversion: '${spring}'
+ commons: '${springdata.commons.docs}'
+ lettuce: '${lettuce}'
+ jedis: '${jedis}'
include-xml-namespaces: false
- spring-data-commons-docs-url: https://docs.spring.io/spring-data/commons/reference
- spring-data-commons-javadoc-base: https://docs.spring.io/spring-data/commons/docs/${springdata.commons}/api/
- springdocsurl: https://docs.spring.io/spring-framework/reference/{springversionshort}
- springjavadocurl: https://docs.spring.io/spring-framework/docs/${spring}/javadoc-api
+ spring-data-commons-docs-url: '${documentation.baseurl}/spring-data/commons/reference/${springdata.commons.short}'
+ spring-data-commons-javadoc-base: '{spring-data-commons-docs-url}/api/java'
+ springdocsurl: '${documentation.baseurl}/spring-framework/reference/{springversionshort}'
spring-framework-docs: '{springdocsurl}'
+ springjavadocurl: '${documentation.spring-javadoc-url}'
spring-framework-javadoc: '{springjavadocurl}'
- springhateoasversion: ${spring-hateoas}
- releasetrainversion: ${releasetrain}
+ springhateoasversion: '${spring-hateoas}'
+ releasetrainversion: '${releasetrain}'
store: Redis
diff --git a/src/main/java/org/springframework/data/redis/ClusterRedirectException.java b/src/main/java/org/springframework/data/redis/ClusterRedirectException.java
index 562347e86a..56774cdf00 100644
--- a/src/main/java/org/springframework/data/redis/ClusterRedirectException.java
+++ b/src/main/java/org/springframework/data/redis/ClusterRedirectException.java
@@ -29,8 +29,7 @@
*/
public class ClusterRedirectException extends DataRetrievalFailureException {
- @Serial
- private static final long serialVersionUID = -857075813794333965L;
+ @Serial private static final long serialVersionUID = -857075813794333965L;
private final int slot;
private final String host;
diff --git a/src/main/java/org/springframework/data/redis/ClusterStateFailureException.java b/src/main/java/org/springframework/data/redis/ClusterStateFailureException.java
index 29543870d6..f46e9cde61 100644
--- a/src/main/java/org/springframework/data/redis/ClusterStateFailureException.java
+++ b/src/main/java/org/springframework/data/redis/ClusterStateFailureException.java
@@ -30,8 +30,7 @@
*/
public class ClusterStateFailureException extends DataAccessResourceFailureException {
- @Serial
- private static final long serialVersionUID = 333399051713240852L;
+ @Serial private static final long serialVersionUID = 333399051713240852L;
/**
* Creates new {@link ClusterStateFailureException}.
diff --git a/src/main/java/org/springframework/data/redis/TooManyClusterRedirectionsException.java b/src/main/java/org/springframework/data/redis/TooManyClusterRedirectionsException.java
index e985374ae7..410661bed4 100644
--- a/src/main/java/org/springframework/data/redis/TooManyClusterRedirectionsException.java
+++ b/src/main/java/org/springframework/data/redis/TooManyClusterRedirectionsException.java
@@ -27,8 +27,7 @@
*/
public class TooManyClusterRedirectionsException extends DataRetrievalFailureException {
- @Serial
- private static final long serialVersionUID = -2818933672669154328L;
+ @Serial private static final long serialVersionUID = -2818933672669154328L;
/**
* Creates new {@link TooManyClusterRedirectionsException}.
diff --git a/src/main/java/org/springframework/data/redis/cache/BatchStrategies.java b/src/main/java/org/springframework/data/redis/cache/BatchStrategies.java
index dc808e516e..41b1cfe3eb 100644
--- a/src/main/java/org/springframework/data/redis/cache/BatchStrategies.java
+++ b/src/main/java/org/springframework/data/redis/cache/BatchStrategies.java
@@ -16,16 +16,17 @@
package org.springframework.data.redis.cache;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
-import java.util.Optional;
+import java.util.Set;
import org.springframework.data.redis.connection.RedisConnection;
+import org.springframework.data.redis.connection.RedisKeyCommands;
import org.springframework.data.redis.core.Cursor;
import org.springframework.data.redis.core.ScanOptions;
import org.springframework.util.Assert;
+import org.springframework.util.CollectionUtils;
/**
* Collection of predefined {@link BatchStrategy} implementations using the Redis {@code KEYS} or {@code SCAN} command.
@@ -33,6 +34,7 @@
* @author Mark Paluch
* @author Christoph Strobl
* @author John Blum
+ * @author Yong-Hyun Kim
* @since 2.6
*/
public abstract class BatchStrategies {
@@ -79,14 +81,17 @@ static class Keys implements BatchStrategy {
@Override
public long cleanCache(RedisConnection connection, String name, byte[] pattern) {
- byte[][] keys = Optional.ofNullable(connection.keys(pattern)).orElse(Collections.emptySet())
- .toArray(new byte[0][]);
+ RedisKeyCommands commands = connection.keyCommands();
- if (keys.length > 0) {
- connection.del(keys);
+ Set keys = commands.keys(pattern);
+
+ if (CollectionUtils.isEmpty(keys)) {
+ return 0;
}
- return keys.length;
+ commands.del(keys.toArray(new byte[0][]));
+
+ return keys.size();
}
}
diff --git a/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java b/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java
index 6d340afdad..c9d25b9136 100644
--- a/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java
+++ b/src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java
@@ -18,8 +18,8 @@
import org.springframework.util.Assert;
/**
- * {@link CacheKeyPrefix} is a callback hook for creating custom prefixes prepended to the actual {@literal key}
- * stored in Redis.
+ * {@link CacheKeyPrefix} is a callback hook for creating custom prefixes prepended to the actual {@literal key} stored
+ * in Redis.
*
* @author Christoph Strobl
* @author Mark Paluch
@@ -39,18 +39,15 @@ public interface CacheKeyPrefix {
/**
* Compute the {@link String prefix} for the actual {@literal cache key} stored in Redis.
*
- * @param cacheName {@link String name} of the cache in which the key is stored;
- * will never be {@literal null}.
- * @return the computed {@link String prefix} of the {@literal cache key} stored in Redis;
- * never {@literal null}.
+ * @param cacheName {@link String name} of the cache in which the key is stored; will never be {@literal null}.
+ * @return the computed {@link String prefix} of the {@literal cache key} stored in Redis; never {@literal null}.
*/
String compute(String cacheName);
/**
- * Creates a default {@link CacheKeyPrefix} scheme that prefixes cache keys with the {@link String name}
- * of the cache followed by double colons.
- *
- * For example, a cache named {@literal myCache} will prefix all cache keys with {@literal myCache::}.
+ * Creates a default {@link CacheKeyPrefix} scheme that prefixes cache keys with the {@link String name} of the cache
+ * followed by double colons. For example, a cache named {@literal myCache} will prefix all cache keys with
+ * {@literal myCache::}.
*
* @return the default {@link CacheKeyPrefix} scheme.
*/
@@ -59,12 +56,9 @@ static CacheKeyPrefix simple() {
}
/**
- * Creates a {@link CacheKeyPrefix} scheme that prefixes cache keys with the given {@link String prefix}.
- *
- * The {@link String prefix} is prepended to the {@link String cacheName} followed by double colons.
- *
- * For example, a prefix {@literal redis-} with a cache named {@literal myCache}
- * results in {@literal redis-myCache::}.
+ * Creates a {@link CacheKeyPrefix} scheme that prefixes cache keys with the given {@link String prefix}. The
+ * {@link String prefix} is prepended to the {@link String cacheName} followed by double colons. For example, a prefix
+ * {@literal redis-} with a cache named {@literal myCache} results in {@literal redis-myCache::}.
*
* @param prefix must not be {@literal null}.
* @return the default {@link CacheKeyPrefix} scheme.
diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java b/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java
index b74ebf2d75..b2c5669f83 100644
--- a/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java
+++ b/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java
@@ -35,9 +35,9 @@
* Immutable {@link RedisCacheConfiguration} used to customize {@link RedisCache} behavior, such as caching
* {@literal null} values, computing cache key prefixes and handling binary serialization.
*
- * Start with {@link RedisCacheConfiguration#defaultCacheConfig()} and customize {@link RedisCache} behavior
- * using the builder methods, such as {@link #entryTtl(Duration)}, {@link #serializeKeysWith(SerializationPair)}
- * and {@link #serializeValuesWith(SerializationPair)}.
+ * Start with {@link RedisCacheConfiguration#defaultCacheConfig()} and customize {@link RedisCache} behavior using the
+ * builder methods, such as {@link #entryTtl(Duration)}, {@link #serializeKeysWith(SerializationPair)} and
+ * {@link #serializeValuesWith(SerializationPair)}.
*
* @author Christoph Strobl
* @author Mark Paluch
@@ -110,14 +110,10 @@ public static RedisCacheConfiguration defaultCacheConfig(@Nullable ClassLoader c
registerDefaultConverters(conversionService);
- return new RedisCacheConfiguration(TtlFunction.persistent(),
- DEFAULT_CACHE_NULL_VALUES,
- DEFAULT_ENABLE_TIME_TO_IDLE_EXPIRATION,
- DEFAULT_USE_PREFIX,
- CacheKeyPrefix.simple(),
+ return new RedisCacheConfiguration(TtlFunction.persistent(), DEFAULT_CACHE_NULL_VALUES,
+ DEFAULT_ENABLE_TIME_TO_IDLE_EXPIRATION, DEFAULT_USE_PREFIX, CacheKeyPrefix.simple(),
SerializationPair.fromSerializer(RedisSerializer.string()),
- SerializationPair.fromSerializer(RedisSerializer.java(classLoader)),
- conversionService);
+ SerializationPair.fromSerializer(RedisSerializer.java(classLoader)), conversionService);
}
private final boolean cacheNullValues;
@@ -189,9 +185,8 @@ DEFAULT_USE_PREFIX, cacheKeyPrefix, getKeySerializationPair(), getValueSerializa
* @return new {@link RedisCacheConfiguration}.
*/
public RedisCacheConfiguration disableCachingNullValues() {
- return new RedisCacheConfiguration(getTtlFunction(), DO_NOT_CACHE_NULL_VALUES, isTimeToIdleEnabled(),
- usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(),
- getConversionService());
+ return new RedisCacheConfiguration(getTtlFunction(), DO_NOT_CACHE_NULL_VALUES, isTimeToIdleEnabled(), usePrefix(),
+ getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), getConversionService());
}
/**
@@ -203,21 +198,22 @@ public RedisCacheConfiguration disableCachingNullValues() {
*/
public RedisCacheConfiguration disableKeyPrefix() {
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(),
- DO_NOT_USE_PREFIX, getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), getConversionService());
+ DO_NOT_USE_PREFIX, getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(),
+ getConversionService());
}
/**
- * Enables {@literal time-to-idle (TTI) expiration} on {@link Cache} read operations,
- * such as {@link Cache#get(Object)}.
+ * Enables {@literal time-to-idle (TTI) expiration} on {@link Cache} read operations, such as
+ * {@link Cache#get(Object)}.
*
* Enabling this option applies the same {@link #getTtlFunction() TTL expiration policy} to {@link Cache} read
* operations as it does for {@link Cache} write operations. In effect, this will invoke the Redis {@literal GETEX}
* command in place of {@literal GET}.
*
- * Redis does not support the concept of {@literal TTI}, only {@literal TTL}. However, if {@literal TTL} expiration
- * is applied to all {@link Cache} operations, both read and write alike, and {@link Cache} operations passed with
- * expiration are used consistently across the application, then in effect, an application can achieve
- * {@literal TTI} expiration-like behavior.
+ * Redis does not support the concept of {@literal TTI}, only {@literal TTL}. However, if {@literal TTL} expiration is
+ * applied to all {@link Cache} operations, both read and write alike, and {@link Cache} operations passed with
+ * expiration are used consistently across the application, then in effect, an application can achieve {@literal TTI}
+ * expiration-like behavior.
*
* Requires Redis 6.2.0 or newer.
*
@@ -227,8 +223,7 @@ public RedisCacheConfiguration disableKeyPrefix() {
*/
public RedisCacheConfiguration enableTimeToIdle() {
return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), USE_TIME_TO_IDLE_EXPIRATION,
- usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(),
- getConversionService());
+ usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), getConversionService());
}
/**
@@ -256,9 +251,8 @@ public RedisCacheConfiguration entryTtl(TtlFunction ttlFunction) {
Assert.notNull(ttlFunction, "TtlFunction must not be null");
- return new RedisCacheConfiguration(ttlFunction, getAllowCacheNullValues(), isTimeToIdleEnabled(),
- usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(),
- getConversionService());
+ return new RedisCacheConfiguration(ttlFunction, getAllowCacheNullValues(), isTimeToIdleEnabled(), usePrefix(),
+ getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), getConversionService());
}
/**
@@ -271,8 +265,8 @@ public RedisCacheConfiguration serializeKeysWith(SerializationPair keySe
Assert.notNull(keySerializationPair, "KeySerializationPair must not be null");
- return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(),
- usePrefix(), getKeyPrefix(), keySerializationPair, getValueSerializationPair(), getConversionService());
+ return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(), usePrefix(),
+ getKeyPrefix(), keySerializationPair, getValueSerializationPair(), getConversionService());
}
/**
@@ -285,8 +279,8 @@ public RedisCacheConfiguration serializeValuesWith(SerializationPair> valueSer
Assert.notNull(valueSerializationPair, "ValueSerializationPair must not be null");
- return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(),
- usePrefix(), getKeyPrefix(), getKeySerializationPair(), valueSerializationPair, getConversionService());
+ return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(), usePrefix(),
+ getKeyPrefix(), getKeySerializationPair(), valueSerializationPair, getConversionService());
}
/**
@@ -299,8 +293,8 @@ public RedisCacheConfiguration withConversionService(ConversionService conversio
Assert.notNull(conversionService, "ConversionService must not be null");
- return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(),
- usePrefix(), getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), conversionService);
+ return new RedisCacheConfiguration(getTtlFunction(), getAllowCacheNullValues(), isTimeToIdleEnabled(), usePrefix(),
+ getKeyPrefix(), getKeySerializationPair(), getValueSerializationPair(), conversionService);
}
/**
@@ -316,7 +310,7 @@ public boolean getAllowCacheNullValues() {
* Use {@link #enableTimeToIdle()} to opt-in and enable {@literal time-to-idle (TTI) expiration} for caching.
*
* @return {@literal true} if {@literal time-to-idle (TTI) expiration} was configured and enabled for caching.
- * Defaults to {@literal false}.
+ * Defaults to {@literal false}.
* @see GETEX
* @since 3.2.0
*/
@@ -400,8 +394,8 @@ public TtlFunction getTtlFunction() {
}
/**
- * Adds a {@link Converter} to extract the {@link String} representation of a {@literal cache key}
- * if no suitable {@link Object#toString()} method is present.
+ * Adds a {@link Converter} to extract the {@link String} representation of a {@literal cache key} if no suitable
+ * {@link Object#toString()} method is present.
*
* @param cacheKeyConverter {@link Converter} used to convert a {@literal cache key} into a {@link String}.
* @throws IllegalStateException if {@link #getConversionService()} does not allow {@link Converter} registration.
@@ -415,8 +409,8 @@ public void addCacheKeyConverter(Converter, String> cacheKeyConverter) {
/**
* Configure the underlying {@link ConversionService} used to extract the {@literal cache key}.
*
- * @param registryConsumer {@link Consumer} used to register a {@link Converter}
- * with the configured {@link ConverterRegistry}; never {@literal null}.
+ * @param registryConsumer {@link Consumer} used to register a {@link Converter} with the configured
+ * {@link ConverterRegistry}; never {@literal null}.
* @throws IllegalStateException if {@link #getConversionService()} does not allow {@link Converter} registration.
* @see org.springframework.core.convert.converter.ConverterRegistry
* @since 2.2
diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java b/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java
index 3c9e3c5415..83dc0e9ec1 100644
--- a/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java
+++ b/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java
@@ -33,8 +33,8 @@
/**
* {@link CacheManager} implementation for Redis backed by {@link RedisCache}.
*
- * This {@link CacheManager} creates {@link Cache caches} on first write, by default. Empty {@link Cache caches}
- * are not visible in Redis due to how Redis represents empty data structures.
+ * This {@link CacheManager} creates {@link Cache caches} on first write, by default. Empty {@link Cache caches} are not
+ * visible in Redis due to how Redis represents empty data structures.
*
* {@link Cache Caches} requiring a different {@link RedisCacheConfiguration cache configuration} than the
* {@link RedisCacheConfiguration#defaultCacheConfig() default cache configuration} can be specified via
@@ -70,12 +70,12 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager
*
* Allows {@link RedisCache cache} creation at runtime.
*
- * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations
- * by executing appropriate Redis commands; must not be {@literal null}.
- * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches}
- * by default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
+ * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations by executing appropriate
+ * Redis commands; must not be {@literal null}.
+ * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches} by
+ * default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
* @throws IllegalArgumentException if either the given {@link RedisCacheWriter} or {@link RedisCacheConfiguration}
- * are {@literal null}.
+ * are {@literal null}.
* @see org.springframework.data.redis.cache.RedisCacheConfiguration
* @see org.springframework.data.redis.cache.RedisCacheWriter
*/
@@ -84,17 +84,17 @@ public RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration d
}
/**
- * Creates a new {@link RedisCacheManager} initialized with the given {@link RedisCacheWriter}
- * and default {@link RedisCacheConfiguration} along with whether to allow cache creation at runtime.
+ * Creates a new {@link RedisCacheManager} initialized with the given {@link RedisCacheWriter} and default
+ * {@link RedisCacheConfiguration} along with whether to allow cache creation at runtime.
*
- * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations
- * by executing appropriate Redis commands; must not be {@literal null}.
- * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches}
- * by default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
+ * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations by executing appropriate
+ * Redis commands; must not be {@literal null}.
+ * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches} by
+ * default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
* @param allowRuntimeCacheCreation boolean specifying whether to allow creation of undeclared caches at runtime;
- * {@literal true} by default. Maybe just use {@link RedisCacheConfiguration#defaultCacheConfig()}.
+ * {@literal true} by default. Maybe just use {@link RedisCacheConfiguration#defaultCacheConfig()}.
* @throws IllegalArgumentException if either the given {@link RedisCacheWriter} or {@link RedisCacheConfiguration}
- * are {@literal null}.
+ * are {@literal null}.
* @see org.springframework.data.redis.cache.RedisCacheConfiguration
* @see org.springframework.data.redis.cache.RedisCacheWriter
* @since 2.0.4
@@ -113,19 +113,19 @@ private RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration
/**
* Creates a new {@link RedisCacheManager} initialized with the given {@link RedisCacheWriter} and a default
- * {@link RedisCacheConfiguration} along with an optional, initial set of {@link String cache names}
- * used to create {@link RedisCache Redis caches} on startup.
+ * {@link RedisCacheConfiguration} along with an optional, initial set of {@link String cache names} used to create
+ * {@link RedisCache Redis caches} on startup.
*
* Allows {@link RedisCache cache} creation at runtime.
*
- * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations
- * by executing appropriate Redis commands; must not be {@literal null}.
- * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches}
- * by default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
+ * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations by executing appropriate
+ * Redis commands; must not be {@literal null}.
+ * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches} by
+ * default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
* @param initialCacheNames optional set of {@link String cache names} used to create {@link RedisCache Redis caches}
- * on startup. The default {@link RedisCacheConfiguration} will be applied to each cache.
+ * on startup. The default {@link RedisCacheConfiguration} will be applied to each cache.
* @throws IllegalArgumentException if either the given {@link RedisCacheWriter} or {@link RedisCacheConfiguration}
- * are {@literal null}.
+ * are {@literal null}.
* @see org.springframework.data.redis.cache.RedisCacheConfiguration
* @see org.springframework.data.redis.cache.RedisCacheWriter
*/
@@ -139,19 +139,19 @@ public RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration d
* Creates a new {@link RedisCacheManager} initialized with the given {@link RedisCacheWriter} and default
* {@link RedisCacheConfiguration} along with whether to allow cache creation at runtime.
*
- * Additionally, the optional, initial set of {@link String cache names} will be used to
- * create {@link RedisCache Redis caches} on startup.
+ * Additionally, the optional, initial set of {@link String cache names} will be used to create {@link RedisCache
+ * Redis caches} on startup.
*
- * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations
- * by executing appropriate Redis commands; must not be {@literal null}.
- * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches}
- * by default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
+ * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations by executing appropriate
+ * Redis commands; must not be {@literal null}.
+ * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches} by
+ * default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
* @param allowRuntimeCacheCreation boolean specifying whether to allow creation of undeclared caches at runtime;
- * {@literal true} by default. Maybe just use {@link RedisCacheConfiguration#defaultCacheConfig()}.
+ * {@literal true} by default. Maybe just use {@link RedisCacheConfiguration#defaultCacheConfig()}.
* @param initialCacheNames optional set of {@link String cache names} used to create {@link RedisCache Redis caches}
- * on startup. The default {@link RedisCacheConfiguration} will be applied to each cache.
+ * on startup. The default {@link RedisCacheConfiguration} will be applied to each cache.
* @throws IllegalArgumentException if either the given {@link RedisCacheWriter} or {@link RedisCacheConfiguration}
- * are {@literal null}.
+ * are {@literal null}.
* @see org.springframework.data.redis.cache.RedisCacheConfiguration
* @see org.springframework.data.redis.cache.RedisCacheWriter
* @since 2.0.4
@@ -175,15 +175,15 @@ public RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration d
*
* Allows {@link RedisCache cache} creation at runtime.
*
- * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations
- * by executing appropriate Redis commands; must not be {@literal null}.
- * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches}
- * by default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
+ * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations by executing appropriate
+ * Redis commands; must not be {@literal null}.
+ * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches} by
+ * default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
* @param initialCacheConfigurations {@link Map} of declared, known {@link String cache names} along with associated
- * {@link RedisCacheConfiguration} used to create and configure {@link RedisCache Reds caches} on startup;
- * must not be {@literal null}.
+ * {@link RedisCacheConfiguration} used to create and configure {@link RedisCache Reds caches} on startup;
+ * must not be {@literal null}.
* @throws IllegalArgumentException if either the given {@link RedisCacheWriter} or {@link RedisCacheConfiguration}
- * are {@literal null}.
+ * are {@literal null}.
* @see org.springframework.data.redis.cache.RedisCacheConfiguration
* @see org.springframework.data.redis.cache.RedisCacheWriter
*/
@@ -200,17 +200,17 @@ public RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration d
* Additionally, an initial {@link RedisCache} will be created and configured using the associated
* {@link RedisCacheConfiguration} for each {@link String named} {@link RedisCache} in the given {@link Map}.
*
- * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations
- * by executing appropriate Redis commands; must not be {@literal null}.
- * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches}
- * by default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
+ * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations by executing appropriate
+ * Redis commands; must not be {@literal null}.
+ * @param defaultCacheConfiguration {@link RedisCacheConfiguration} applied to new {@link RedisCache Redis caches} by
+ * default when no cache-specific {@link RedisCacheConfiguration} is provided; must not be {@literal null}.
* @param allowRuntimeCacheCreation boolean specifying whether to allow creation of undeclared caches at runtime;
- * {@literal true} by default. Maybe just use {@link RedisCacheConfiguration#defaultCacheConfig()}.
+ * {@literal true} by default. Maybe just use {@link RedisCacheConfiguration#defaultCacheConfig()}.
* @param initialCacheConfigurations {@link Map} of declared, known {@link String cache names} along with the
- * associated {@link RedisCacheConfiguration} used to create and configure {@link RedisCache Redis caches}
- * on startup; must not be {@literal null}.
+ * associated {@link RedisCacheConfiguration} used to create and configure {@link RedisCache Redis caches} on
+ * startup; must not be {@literal null}.
* @throws IllegalArgumentException if either the given {@link RedisCacheWriter} or {@link RedisCacheConfiguration}
- * are {@literal null}.
+ * are {@literal null}.
* @see org.springframework.data.redis.cache.RedisCacheConfiguration
* @see org.springframework.data.redis.cache.RedisCacheWriter
* @since 2.0.4
@@ -226,7 +226,9 @@ public RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration d
}
/**
- * @deprecated since 3.2. Use {@link RedisCacheManager#RedisCacheManager(RedisCacheWriter, RedisCacheConfiguration, boolean, Map)} instead.
+ * @deprecated since 3.2. Use
+ * {@link RedisCacheManager#RedisCacheManager(RedisCacheWriter, RedisCacheConfiguration, boolean, Map)}
+ * instead.
*/
@Deprecated(since = "3.2")
public RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration,
@@ -249,8 +251,8 @@ public static RedisCacheManagerBuilder builder() {
* Factory method returning a {@literal Builder} used to construct and configure a {@link RedisCacheManager}
* initialized with the given {@link RedisCacheWriter}.
*
- * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations
- * by executing appropriate Redis commands; must not be {@literal null}.
+ * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations by executing appropriate
+ * Redis commands; must not be {@literal null}.
* @return new {@link RedisCacheManagerBuilder}.
* @throws IllegalArgumentException if the given {@link RedisCacheWriter} is {@literal null}.
* @see org.springframework.data.redis.cache.RedisCacheWriter
@@ -266,8 +268,8 @@ public static RedisCacheManagerBuilder builder(RedisCacheWriter cacheWriter) {
* Factory method returning a {@literal Builder} used to construct and configure a {@link RedisCacheManager}
* initialized with the given {@link RedisConnectionFactory}.
*
- * @param connectionFactory {@link RedisConnectionFactory} used by the {@link RedisCacheManager}
- * to acquire connections to Redis when performing {@link RedisCache} operations; must not be {@literal null}.
+ * @param connectionFactory {@link RedisConnectionFactory} used by the {@link RedisCacheManager} to acquire
+ * connections to Redis when performing {@link RedisCache} operations; must not be {@literal null}.
* @return new {@link RedisCacheManagerBuilder}.
* @throws IllegalArgumentException if the given {@link RedisConnectionFactory} is {@literal null}.
* @see org.springframework.data.redis.connection.RedisConnectionFactory
@@ -297,8 +299,8 @@ public static RedisCacheManagerBuilder builder(RedisConnectionFactory connection
*
enabled
*
*
- * @param connectionFactory {@link RedisConnectionFactory} used by the {@link RedisCacheManager}
- * to acquire connections to Redis when performing {@link RedisCache} operations; must not be {@literal null}.
+ * @param connectionFactory {@link RedisConnectionFactory} used by the {@link RedisCacheManager} to acquire
+ * connections to Redis when performing {@link RedisCache} operations; must not be {@literal null}.
* @return new {@link RedisCacheManager}.
* @throws IllegalArgumentException if the given {@link RedisConnectionFactory} is {@literal null}.
* @see org.springframework.data.redis.connection.RedisConnectionFactory
@@ -326,8 +328,8 @@ public boolean isAllowRuntimeCacheCreation() {
* Return an {@link Collections#unmodifiableMap(Map) unmodifiable Map} containing {@link String caches name} mapped to
* the {@link RedisCache} {@link RedisCacheConfiguration configuration}.
*
- * @return unmodifiable {@link Map} containing {@link String cache name}
- * / {@link RedisCacheConfiguration configuration} pairs.
+ * @return unmodifiable {@link Map} containing {@link String cache name} / {@link RedisCacheConfiguration
+ * configuration} pairs.
*/
public Map getCacheConfigurations() {
@@ -353,8 +355,8 @@ protected RedisCacheConfiguration getDefaultCacheConfiguration() {
}
/**
- * Gets a {@link Map} of {@link String cache names} to {@link RedisCacheConfiguration} objects as the initial set
- * of {@link RedisCache Redis caches} to create on startup.
+ * Gets a {@link Map} of {@link String cache names} to {@link RedisCacheConfiguration} objects as the initial set of
+ * {@link RedisCache Redis caches} to create on startup.
*
* @return a {@link Map} of {@link String cache names} to {@link RedisCacheConfiguration} objects.
*/
@@ -363,8 +365,8 @@ protected Map getInitialCacheConfiguration() {
}
/**
- * Returns a reference to the configured {@link RedisCacheWriter} used to perform {@link RedisCache} operations,
- * such as reading from and writing to the cache.
+ * Returns a reference to the configured {@link RedisCacheWriter} used to perform {@link RedisCache} operations, such
+ * as reading from and writing to the cache.
*
* @return a reference to the configured {@link RedisCacheWriter}.
* @see org.springframework.data.redis.cache.RedisCacheWriter
@@ -382,8 +384,8 @@ protected RedisCache getMissingCache(String name) {
* Creates a new {@link RedisCache} with given {@link String name} and {@link RedisCacheConfiguration}.
*
* @param name {@link String name} for the {@link RedisCache}; must not be {@literal null}.
- * @param cacheConfiguration {@link RedisCacheConfiguration} used to configure the {@link RedisCache};
- * resolves to the {@link #getDefaultCacheConfiguration()} if {@literal null}.
+ * @param cacheConfiguration {@link RedisCacheConfiguration} used to configure the {@link RedisCache}; resolves to the
+ * {@link #getDefaultCacheConfiguration()} if {@literal null}.
* @return a new {@link RedisCache} instance; never {@literal null}.
*/
protected RedisCache createRedisCache(String name, @Nullable RedisCacheConfiguration cacheConfiguration) {
@@ -416,8 +418,8 @@ public static class RedisCacheManagerBuilder {
* Factory method returning a new {@literal Builder} used to create and configure a {@link RedisCacheManager} using
* the given {@link RedisCacheWriter}.
*
- * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations
- * by executing appropriate Redis commands; must not be {@literal null}.
+ * @param cacheWriter {@link RedisCacheWriter} used to perform {@link RedisCache} operations by executing
+ * appropriate Redis commands; must not be {@literal null}.
* @return new {@link RedisCacheManagerBuilder}.
* @throws IllegalArgumentException if the given {@link RedisCacheWriter} is {@literal null}.
* @see org.springframework.data.redis.cache.RedisCacheWriter
@@ -433,8 +435,8 @@ public static RedisCacheManagerBuilder fromCacheWriter(RedisCacheWriter cacheWri
* Factory method returning a new {@literal Builder} used to create and configure a {@link RedisCacheManager} using
* the given {@link RedisConnectionFactory}.
*
- * @param connectionFactory {@link RedisConnectionFactory} used by the {@link RedisCacheManager}
- * to acquire connections to Redis when performing {@link RedisCache} operations; must not be {@literal null}.
+ * @param connectionFactory {@link RedisConnectionFactory} used by the {@link RedisCacheManager} to acquire
+ * connections to Redis when performing {@link RedisCache} operations; must not be {@literal null}.
* @return new {@link RedisCacheManagerBuilder}.
* @throws IllegalArgumentException if the given {@link RedisConnectionFactory} is {@literal null}.
* @see org.springframework.data.redis.connection.RedisConnectionFactory
@@ -468,8 +470,8 @@ private RedisCacheManagerBuilder(RedisCacheWriter cacheWriter) {
/**
* Configure whether to allow cache creation at runtime.
*
- * @param allowRuntimeCacheCreation boolean to allow creation of undeclared caches at runtime;
- * {@literal true} by default.
+ * @param allowRuntimeCacheCreation boolean to allow creation of undeclared caches at runtime; {@literal true} by
+ * default.
* @return this {@link RedisCacheManagerBuilder}.
*/
public RedisCacheManagerBuilder allowCreateOnMissingCache(boolean allowRuntimeCacheCreation) {
@@ -480,9 +482,9 @@ public RedisCacheManagerBuilder allowCreateOnMissingCache(boolean allowRuntimeCa
/**
* Disable {@link RedisCache} creation at runtime for non-configured, undeclared caches.
*
- * {@link RedisCacheManager#getMissingCache(String)} returns {@literal null} for any non-configured,
- * undeclared {@link Cache} instead of a new {@link RedisCache} instance.
- * This allows the {@link org.springframework.cache.support.CompositeCacheManager} to participate.
+ * {@link RedisCacheManager#getMissingCache(String)} returns {@literal null} for any non-configured, undeclared
+ * {@link Cache} instead of a new {@link RedisCache} instance. This allows the
+ * {@link org.springframework.cache.support.CompositeCacheManager} to participate.
*
* @return this {@link RedisCacheManagerBuilder}.
* @see #allowCreateOnMissingCache(boolean)
@@ -583,8 +585,8 @@ public RedisCacheManagerBuilder transactionAware() {
}
/**
- * Registers the given {@link String cache name} and {@link RedisCacheConfiguration} used to create
- * and configure a {@link RedisCache} on startup.
+ * Registers the given {@link String cache name} and {@link RedisCacheConfiguration} used to create and configure a
+ * {@link RedisCache} on startup.
*
* @param cacheName {@link String name} of the cache to register for creation on startup.
* @param cacheConfiguration {@link RedisCacheConfiguration} used to configure the new cache on startup.
@@ -634,8 +636,8 @@ public Optional getCacheConfigurationFor(String cacheNa
/**
* Get the {@link Set} of cache names for which the builder holds {@link RedisCacheConfiguration configuration}.
*
- * @return an unmodifiable {@link Set} holding the name of caches
- * for which a {@link RedisCacheConfiguration configuration} has been set.
+ * @return an unmodifiable {@link Set} holding the name of caches for which a {@link RedisCacheConfiguration
+ * configuration} has been set.
* @since 2.2
*/
public Set getConfiguredCaches() {
diff --git a/src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java b/src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java
index b0d9c1a720..2bd3e93f35 100644
--- a/src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java
+++ b/src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java
@@ -254,8 +254,7 @@ MultiNodeResult collectResults(Map>>
} catch (ExecutionException ex) {
entryIterator.remove();
exceptionCollector.addException(nodeExecution, ex.getCause());
- } catch (TimeoutException ignore) {
- } catch (InterruptedException ex) {
+ } catch (TimeoutException ignore) {} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
exceptionCollector.addException(nodeExecution, ex);
break OUT;
diff --git a/src/main/java/org/springframework/data/redis/connection/ClusterSlotHashUtil.java b/src/main/java/org/springframework/data/redis/connection/ClusterSlotHashUtil.java
index 58b49520bf..aedf32e72c 100644
--- a/src/main/java/org/springframework/data/redis/connection/ClusterSlotHashUtil.java
+++ b/src/main/java/org/springframework/data/redis/connection/ClusterSlotHashUtil.java
@@ -101,8 +101,8 @@ public static boolean isSameSlotForAllKeys(ByteBuffer... keys) {
/**
* Determines whether all keys will hash to the same slot.
*
- * @param keys {@link Collection} of {@link ByteBuffer} objects containing the keys to evaluate;
- * must not be {@literal null}.
+ * @param keys {@link Collection} of {@link ByteBuffer} objects containing the keys to evaluate; must not be
+ * {@literal null}.
* @return a boolean value indicating whether all keys will hash to the same slot.
* @throws IllegalArgumentException if the {@link Collection} of keys is {@literal null}.
* @since 2.0
@@ -115,10 +115,8 @@ public static boolean isSameSlotForAllKeys(Collection keys) {
return true;
}
- return isSameSlotForAllKeys(keys.stream()
- .map(ByteBuffer::duplicate)
- .map(ByteUtils::getBytes)
- .toArray(byte[][]::new));
+ return isSameSlotForAllKeys(
+ keys.stream().map(ByteBuffer::duplicate).map(ByteUtils::getBytes).toArray(byte[][]::new));
}
/**
diff --git a/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java
index c2ea198d8b..be2c8640bc 100644
--- a/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java
+++ b/src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java
@@ -1404,8 +1404,7 @@ private org.springframework.data.domain.Range.Bound rawBound(
@SuppressWarnings("unchecked")
private GeoReference serialize(GeoReference data) {
return data instanceof GeoReference.GeoMemberReference
- ? GeoReference
- .fromMember(serializer.serialize(((GeoMemberReference) data).getMember()))
+ ? GeoReference.fromMember(serializer.serialize(((GeoMemberReference) data).getMember()))
: (GeoReference) data;
}
@@ -2581,8 +2580,7 @@ public Long hStrLen(byte[] key, byte[] field) {
}
public @Nullable List applyHashFieldExpiration(byte[] key,
- org.springframework.data.redis.core.types.Expiration expiration,
- ExpirationOptions options, byte[]... fields) {
+ org.springframework.data.redis.core.types.Expiration expiration, ExpirationOptions options, byte[]... fields) {
return this.delegate.applyHashFieldExpiration(key, expiration, options, fields);
}
@@ -2628,8 +2626,7 @@ public List hTtl(byte[] key, TimeUnit timeUnit, byte[]... fields) {
}
public @Nullable List applyExpiration(String key,
- org.springframework.data.redis.core.types.Expiration expiration,
- ExpirationOptions options, String... fields) {
+ org.springframework.data.redis.core.types.Expiration expiration, ExpirationOptions options, String... fields) {
return this.applyHashFieldExpiration(serialize(key), expiration, options, serializeMulti(fields));
}
@@ -2818,16 +2815,14 @@ public Set zRevRangeByLex(String key, org.springframework.data.domain.Ra
}
@Override
- public Long zRangeStoreByLex(byte[] dstKey, byte[] srcKey,
- org.springframework.data.domain.Range range,
- org.springframework.data.redis.connection.Limit limit) {
- return convertAndReturn(delegate.zRangeStoreByLex(dstKey, srcKey, range, limit),
- Converters.identityConverter());
+ public Long zRangeStoreByLex(byte[] dstKey, byte[] srcKey, org.springframework.data.domain.Range range,
+ org.springframework.data.redis.connection.Limit limit) {
+ return convertAndReturn(delegate.zRangeStoreByLex(dstKey, srcKey, range, limit), Converters.identityConverter());
}
@Override
- public Long zRangeStoreByLex(String dstKey, String srcKey,
- org.springframework.data.domain.Range range, org.springframework.data.redis.connection.Limit limit) {
+ public Long zRangeStoreByLex(String dstKey, String srcKey, org.springframework.data.domain.Range range,
+ org.springframework.data.redis.connection.Limit limit) {
return convertAndReturn(delegate.zRangeStoreByLex(serialize(dstKey), serialize(srcKey), serialize(range), limit),
Converters.identityConverter());
}
@@ -2848,9 +2843,8 @@ public Long zRangeStoreRevByLex(String dstKey, String srcKey, org.springframewor
@Override
public Long zRangeStoreByScore(byte[] dstKey, byte[] srcKey,
org.springframework.data.domain.Range extends Number> range,
- org.springframework.data.redis.connection.Limit limit) {
- return convertAndReturn(delegate.zRangeStoreByScore(dstKey, srcKey, range, limit),
- Converters.identityConverter());
+ org.springframework.data.redis.connection.Limit limit) {
+ return convertAndReturn(delegate.zRangeStoreByScore(dstKey, srcKey, range, limit), Converters.identityConverter());
}
@Override
diff --git a/src/main/java/org/springframework/data/redis/connection/DefaultedRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/DefaultedRedisConnection.java
index f3be7ab276..1c240dfbf1 100644
--- a/src/main/java/org/springframework/data/redis/connection/DefaultedRedisConnection.java
+++ b/src/main/java/org/springframework/data/redis/connection/DefaultedRedisConnection.java
@@ -1544,8 +1544,7 @@ default List hExpireAt(byte[] key, long unixTime, byte[]... fields) {
/** @deprecated in favor of {@link RedisConnection#hashCommands()}}. */
@Override
@Deprecated
- default List hExpireAt(byte[] key, long unixTime, ExpirationOptions.Condition condition,
- byte[]... fields) {
+ default List hExpireAt(byte[] key, long unixTime, ExpirationOptions.Condition condition, byte[]... fields) {
return hashCommands().hExpireAt(key, unixTime, condition, fields);
}
@@ -1596,8 +1595,7 @@ default List hpTtl(byte[] key, byte[]... fields) {
@Override
@Deprecated
default @Nullable List applyHashFieldExpiration(byte[] key,
- org.springframework.data.redis.core.types.Expiration expiration, ExpirationOptions options,
- byte[]... fields) {
+ org.springframework.data.redis.core.types.Expiration expiration, ExpirationOptions options, byte[]... fields) {
return hashCommands().applyHashFieldExpiration(key, expiration, options, fields);
}
diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveClusterKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveClusterKeyCommands.java
index d650b738eb..23dd8e65e3 100644
--- a/src/main/java/org/springframework/data/redis/connection/ReactiveClusterKeyCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/ReactiveClusterKeyCommands.java
@@ -15,11 +15,11 @@
*/
package org.springframework.data.redis.connection;
+import reactor.core.publisher.Mono;
+
import java.nio.ByteBuffer;
import java.util.List;
-import reactor.core.publisher.Mono;
-
/**
* @author Christoph Strobl
* @since 2.0
diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveClusterStreamCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveClusterStreamCommands.java
index d2dacc7fad..42b29a7b91 100644
--- a/src/main/java/org/springframework/data/redis/connection/ReactiveClusterStreamCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/ReactiveClusterStreamCommands.java
@@ -19,5 +19,4 @@
* @author Mark Paluch
* @since 2.2
*/
-public interface ReactiveClusterStreamCommands extends ReactiveStreamCommands {
-}
+public interface ReactiveClusterStreamCommands extends ReactiveStreamCommands {}
diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveGeoCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveGeoCommands.java
index 80c9fde257..c6172a677b 100644
--- a/src/main/java/org/springframework/data/redis/connection/ReactiveGeoCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/ReactiveGeoCommands.java
@@ -826,7 +826,7 @@ public Optional getLimit() {
}
/**
- * @return can be {@literal null}.
+ * @return can be {@literal null}.
*/
@Nullable
public Point getPoint() {
@@ -1159,7 +1159,7 @@ public Optional getLimit() {
}
/**
- * @return can be {@literal null}.
+ * @return can be {@literal null}.
*/
@Nullable
public ByteBuffer getMember() {
@@ -1229,7 +1229,7 @@ default Flux>> geoRadiusByMember(ByteBuffer ke
return geoRadiusByMember(
Mono.just(GeoRadiusByMemberCommand.within(distance).from(member).forKey(key).withArgs(geoRadiusArgs)))
- .flatMap(CommandResponse::getOutput);
+ .flatMap(CommandResponse::getOutput);
}
/**
@@ -1484,7 +1484,7 @@ default Mono geoSearchStore(ByteBuffer destKey, ByteBuffer key, GeoReferen
GeoShape shape, GeoSearchStoreCommandArgs args) {
return geoSearchStore(
Mono.just(GeoSearchStoreCommand.within(shape).in(key).storeAt(destKey).at(reference).with(args))).next()
- .map(CommandResponse::getOutput);
+ .map(CommandResponse::getOutput);
}
/**
diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java
index 3354cf9af1..877a787f5e 100644
--- a/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java
@@ -244,9 +244,10 @@ default Mono touch(Collection keys) {
Flux, Long>> touch(Publisher> keys);
/**
- * Find all keys matching the given {@literal pattern}.
- * It is recommended to use {@link #scan(ScanOptions)} to iterate over the keyspace as {@link #keys(ByteBuffer)} is a
- * non-interruptible and expensive Redis operation.
+ * Retrieve all keys matching the given pattern via {@code KEYS} command.
+ *
+ * IMPORTANT: This command is non-interruptible and scans the entire keyspace which may cause
+ * performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
*
* @param pattern must not be {@literal null}.
* @return
diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveStreamCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveStreamCommands.java
index 2860dc691c..e091b6f7df 100644
--- a/src/main/java/org/springframework/data/redis/connection/ReactiveStreamCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/ReactiveStreamCommands.java
@@ -27,12 +27,13 @@
import java.util.Map;
import org.reactivestreams.Publisher;
+
import org.springframework.data.domain.Range;
import org.springframework.data.redis.connection.ReactiveRedisConnection.CommandResponse;
import org.springframework.data.redis.connection.ReactiveRedisConnection.KeyCommand;
import org.springframework.data.redis.connection.ReactiveRedisConnection.NumericResponse;
-import org.springframework.data.redis.connection.RedisStreamCommands.XClaimOptions;
import org.springframework.data.redis.connection.RedisStreamCommands.XAddOptions;
+import org.springframework.data.redis.connection.RedisStreamCommands.XClaimOptions;
import org.springframework.data.redis.connection.RedisStreamCommands.XPendingOptions;
import org.springframework.data.redis.connection.stream.ByteBufferRecord;
import org.springframework.data.redis.connection.stream.Consumer;
@@ -411,8 +412,7 @@ default Mono xAdd(ByteBufferRecord record, XAddOptions xAddOptions) {
Assert.notNull(xAddOptions, "XAddOptions must not be null");
AddStreamRecord addStreamRecord = AddStreamRecord.of(record)
- .approximateTrimming(xAddOptions.isApproximateTrimming())
- .makeNoStream(xAddOptions.isNoMkStream());
+ .approximateTrimming(xAddOptions.isApproximateTrimming()).makeNoStream(xAddOptions.isNoMkStream());
if (xAddOptions.hasMaxlen()) {
addStreamRecord = addStreamRecord.maxlen(xAddOptions.getMaxlen());
diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java b/src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java
index 153d139e8f..c5e74e60de 100644
--- a/src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java
+++ b/src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java
@@ -15,13 +15,13 @@
*/
package org.springframework.data.redis.connection;
-import org.springframework.lang.Nullable;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.nio.ByteBuffer;
import java.util.Set;
+import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveZSetCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveZSetCommands.java
index c4037e2c55..f9761d1896 100644
--- a/src/main/java/org/springframework/data/redis/connection/ReactiveZSetCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/ReactiveZSetCommands.java
@@ -1439,7 +1439,7 @@ default Flux zRevRangeByScoreWithScores(ByteBuffer key, Range ran
return zRangeByScore(
Mono.just(ZRangeByScoreCommand.reverseScoresWithin(range).withScores().from(key).limitTo(limit)))
- .flatMap(CommandResponse::getOutput);
+ .flatMap(CommandResponse::getOutput);
}
/**
@@ -2824,7 +2824,7 @@ default Flux zInterWithScores(List sets, List weights
return zInterWithScores(
Mono.just(ZAggregateCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights)))
- .flatMap(CommandResponse::getOutput);
+ .flatMap(CommandResponse::getOutput);
}
/**
@@ -2843,7 +2843,7 @@ default Flux zInterWithScores(List sets, Weights weights, @Nu
return zInterWithScores(
Mono.just(ZAggregateCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights)))
- .flatMap(CommandResponse::getOutput);
+ .flatMap(CommandResponse::getOutput);
}
/**
@@ -2993,7 +2993,7 @@ default Mono zInterStore(ByteBuffer destinationKey, List sets,
return zInterStore(Mono.just(
ZInterStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey)))
- .next().map(NumericResponse::getOutput);
+ .next().map(NumericResponse::getOutput);
}
/**
@@ -3016,7 +3016,7 @@ default Mono zInterStore(ByteBuffer destinationKey, List sets,
return zInterStore(Mono.just(
ZInterStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey)))
- .next().map(NumericResponse::getOutput);
+ .next().map(NumericResponse::getOutput);
}
/**
@@ -3099,7 +3099,7 @@ default Flux zUnionWithScores(List sets, List weights
return zUnionWithScores(
Mono.just(ZAggregateCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights)))
- .flatMap(CommandResponse::getOutput);
+ .flatMap(CommandResponse::getOutput);
}
/**
@@ -3118,7 +3118,7 @@ default Flux zUnionWithScores(List sets, Weights weights, @Nu
return zUnionWithScores(
Mono.just(ZAggregateCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights)))
- .flatMap(CommandResponse::getOutput);
+ .flatMap(CommandResponse::getOutput);
}
/**
@@ -3300,7 +3300,7 @@ default Mono zUnionStore(ByteBuffer destinationKey, List sets,
return zUnionStore(Mono.just(
ZUnionStoreCommand.sets(sets).aggregateUsing(aggregateFunction).applyWeights(weights).storeAs(destinationKey)))
- .next().map(NumericResponse::getOutput);
+ .next().map(NumericResponse::getOutput);
}
/**
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisClusterNode.java b/src/main/java/org/springframework/data/redis/connection/RedisClusterNode.java
index 7a6443d484..506d0c3cae 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisClusterNode.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisClusterNode.java
@@ -216,8 +216,8 @@ public SlotRange(BitSet range) {
}
/**
- * Determines whether this {@link SlotRange} contains the given {@link Integer slot}, which implies
- * this cluster nodes manages the slot holding data stored in Redis.
+ * Determines whether this {@link SlotRange} contains the given {@link Integer slot}, which implies this cluster
+ * nodes manages the slot holding data stored in Redis.
*
* @param slot {@link Integer slot} to evaluate.
* @return true when slot is part of the range.
@@ -286,14 +286,8 @@ public enum LinkState {
*/
public enum Flag {
- MYSELF("myself"),
- MASTER("master"),
- REPLICA("slave"),
- FAIL("fail"),
- PFAIL("fail?"),
- HANDSHAKE("handshake"),
- NOADDR("noaddr"),
- NOFLAGS("noflags");
+ MYSELF("myself"), MASTER("master"), REPLICA("slave"), FAIL("fail"), PFAIL("fail?"), HANDSHAKE("handshake"), NOADDR(
+ "noaddr"), NOFLAGS("noflags");
private String raw;
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisCommands.java
index 1ebb48b83f..b6c0515304 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisCommands.java
@@ -31,8 +31,8 @@ public interface RedisCommands extends RedisKeyCommands, RedisStringCommands, Re
/**
* {@literal Native} or {@literal raw} execution of the given Redis command along with the given arguments.
*
- * The command is executed as is, with as little interpretation as possible - it is up to the caller to take care
- * of any processing of arguments or the result.
+ * The command is executed as is, with as little interpretation as possible - it is up to the caller to take care of
+ * any processing of arguments or the result.
*
* @param command Redis {@link String command} to execute; must not be {@literal null}.
* @param args optional array of command arguments; may be empty;
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java
index cd99e4a516..c151c502b3 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisHashCommands.java
@@ -500,8 +500,7 @@ default List hpExpireAt(byte[] key, long unixTimeInMillis, byte[]... field
* @since 3.5
*/
@Nullable
- List hpExpireAt(byte[] key, long unixTimeInMillis, ExpirationOptions.Condition condition,
- byte[]... fields);
+ List hpExpireAt(byte[] key, long unixTimeInMillis, ExpirationOptions.Condition condition, byte[]... fields);
/**
* Remove the expiration from given {@code field}.
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java
index 4319dd8705..e79cf2c0f8 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisKeyCommands.java
@@ -122,7 +122,10 @@ default Boolean exists(byte[] key) {
Long touch(byte[]... keys);
/**
- * Find all keys matching the given {@code pattern}.
+ * Retrieve all keys matching the given pattern.
+ *
+ * IMPORTANT: The {@literal KEYS} command is non-interruptible and scans the entire keyspace which
+ * may cause performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
*
* @param pattern must not be {@literal null}.
* @return empty {@link Set} if no match found. {@literal null} when used in pipeline / transaction.
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisPassword.java b/src/main/java/org/springframework/data/redis/connection/RedisPassword.java
index 3fcb4ce343..fc5280c28d 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisPassword.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisPassword.java
@@ -34,6 +34,7 @@
*
* @author Mark Paluch
* @author Christoph Strobl
+ * @author Yong-Hyun Kim
* @since 2.0
*/
public class RedisPassword {
@@ -54,10 +55,11 @@ private RedisPassword(char[] thePassword) {
*/
public static RedisPassword of(@Nullable String passwordAsString) {
- return Optional.ofNullable(passwordAsString) //
- .filter(StringUtils::hasText) //
- .map(it -> new RedisPassword(it.toCharArray())) //
- .orElseGet(RedisPassword::none);
+ if (!StringUtils.hasText(passwordAsString)) {
+ return none();
+ }
+
+ return new RedisPassword(passwordAsString.toCharArray());
}
/**
@@ -68,10 +70,11 @@ public static RedisPassword of(@Nullable String passwordAsString) {
*/
public static RedisPassword of(@Nullable char[] passwordAsChars) {
- return Optional.ofNullable(passwordAsChars) //
- .filter(it -> !ObjectUtils.isEmpty(passwordAsChars)) //
- .map(it -> new RedisPassword(Arrays.copyOf(it, it.length))) //
- .orElseGet(RedisPassword::none);
+ if (ObjectUtils.isEmpty(passwordAsChars)) {
+ return none();
+ }
+
+ return new RedisPassword(Arrays.copyOf(passwordAsChars, passwordAsChars.length));
}
/**
@@ -138,11 +141,6 @@ public Optional toOptional() {
return Optional.empty();
}
- @Override
- public String toString() {
- return "%s[%s]".formatted(getClass().getSimpleName(), isPresent() ? "*****" : "");
- }
-
@Override
public boolean equals(@Nullable Object o) {
@@ -160,4 +158,10 @@ public boolean equals(@Nullable Object o) {
public int hashCode() {
return ObjectUtils.nullSafeHashCode(thePassword);
}
+
+ @Override
+ public String toString() {
+ return "%s[%s]".formatted(getClass().getSimpleName(), isPresent() ? "*****" : "");
+ }
+
}
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java
index 26dcb1976f..255b8f5f0b 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisSetCommands.java
@@ -183,7 +183,6 @@ public interface RedisSetCommands {
@Nullable
Long sUnionStore(byte[] destKey, byte[]... keys);
-
/**
* Get all elements of set at {@code key}.
*
diff --git a/src/main/java/org/springframework/data/redis/connection/RedisStandaloneConfiguration.java b/src/main/java/org/springframework/data/redis/connection/RedisStandaloneConfiguration.java
index 8acb2a3be8..c52b9f0a9f 100644
--- a/src/main/java/org/springframework/data/redis/connection/RedisStandaloneConfiguration.java
+++ b/src/main/java/org/springframework/data/redis/connection/RedisStandaloneConfiguration.java
@@ -23,8 +23,8 @@
import org.springframework.util.ObjectUtils;
/**
- * Configuration class used to set up a {@link RedisConnection} with {@link RedisConnectionFactory} for connecting
- * to a single node Redis instance.
+ * Configuration class used to set up a {@link RedisConnection} with {@link RedisConnectionFactory} for connecting to a
+ * single node Redis instance.
*
* @author Mark Paluch
* @author Christoph Strobl
diff --git a/src/main/java/org/springframework/data/redis/connection/StringRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/StringRedisConnection.java
index dfcc585130..52878517bc 100644
--- a/src/main/java/org/springframework/data/redis/connection/StringRedisConnection.java
+++ b/src/main/java/org/springframework/data/redis/connection/StringRedisConnection.java
@@ -185,7 +185,10 @@ interface StringTuple extends Tuple {
Long touch(String... keys);
/**
- * Find all keys matching the given {@code pattern}.
+ * Retrieve all keys matching the given pattern via {@code KEYS} command.
+ *
+ * IMPORTANT: This command is non-interruptible and scans the entire keyspace which may cause
+ * performance issues. Consider {@link #scan(ScanOptions)} for large datasets.
*
* @param pattern must not be {@literal null}.
* @return
@@ -2531,8 +2534,7 @@ default List hpExpireAt(String key, long unixTimeInMillis, String... field
* @since 3.5
*/
@Nullable
- List hpExpireAt(String key, long unixTimeInMillis, ExpirationOptions.Condition condition,
- String... fields);
+ List hpExpireAt(String key, long unixTimeInMillis, ExpirationOptions.Condition condition, String... fields);
/**
* Remove the expiration from given {@code field}.
diff --git a/src/main/java/org/springframework/data/redis/connection/convert/Converters.java b/src/main/java/org/springframework/data/redis/connection/convert/Converters.java
index 2d4eb2cb59..8a935f69f0 100644
--- a/src/main/java/org/springframework/data/redis/connection/convert/Converters.java
+++ b/src/main/java/org/springframework/data/redis/connection/convert/Converters.java
@@ -544,14 +544,11 @@ enum ClusterNodesConverter implements Converter {
*
*
{@code %s:%i} (Redis 3)
*
{@code %s:%i@%i} (Redis 4, with bus port)
- *
{@code %s:%i@%i,%s} (Redis 7, with announced hostname)
- *
- * The output of the {@code CLUSTER NODES } command is just a space-separated CSV string, where each
- * line represents a node in the cluster. The following is an example of output on Redis 7.2.0.
- * You can check the latest here.
- *
+ *
{@code %s:%i@%i,%s} (Redis 7, with announced hostname)
The output of the {@code CLUSTER NODES } command
+ * is just a space-separated CSV string, where each line represents a node in the cluster. The following is an
+ * example of output on Redis 7.2.0. You can check the latest
+ * here.
* {@code ... }
- *
*