Commit Graph

1130 Commits

Author SHA1 Message Date
Mark Paluch
377ee1804f Polishing.
Make fields final where possible. Reintroduce end of line comment markers to avoid reformatting into unreadable format. Replace HashSet per command instance with String to reduce memory footprint.

Tweak Javadoc wording to represent what we actually expect. Reorder methods.

See #2640
Original pull request: #2644
2023-07-18 10:52:59 +02:00
John Blum
ce8b857a2e Polishing.
Additionally, applied Java 17 syntax, cleaned up compiler warnings, and edited Javadoc.

Closes #2644
Original pull request: #2640
2023-07-18 09:51:52 +02:00
Thach Le
95d5b82ac6 Fix misordered 'final static' modifiers.
Per the Java Language Specification (Java 17; https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-8.3.1), 'static' should appear before 'final'.

This is also consistent with source code analysis tools, like Checkstyle, rules: https://checkstyle.sourceforge.io/apidocs/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.html.

Original pull request: #2640
2023-07-18 09:51:20 +02:00
Mark Paluch
b8a9d5fa0a Polishing.
Use standard assertions. Tweak Javadoc wording.

See #2494
Original pull request: #2645
2023-07-18 09:26:39 +02:00
John Blum
5a12140b49 Make RedisAccessor abstract.
Closes #2494
Original pull request: #2645
2023-07-18 09:26:39 +02:00
Mark Paluch
2e5aed4104 Polishing.
Add documentation for generics. Fix remove() and element() methods to adhere to their contract.

See #2602
Original pull request: #2608
2023-07-13 10:55:55 +02:00
John Blum
a05b25abe5 Adapt RedisList to API changes in Java 21 SequencedCollections.
Closes #2602
Original pull request: #2608
2023-07-13 10:55:55 +02:00
Christoph Strobl
7add798886 Polishing.
Add tests that assert initialization constraints, use early return to default value in case of null and align code format.

Original Pull Request: #2637
2023-07-12 13:53:34 +02:00
Mark Paluch
5d885e24a3 Refine RedisCollectionFactoryBean collection creation.
We now cross-check the existing key type against the specified CollectionType to avoid collection creation that doesn't match the configured CollectionType. If the existing key type doesn't match the configured CollectionType, collection creation fails with a validation error.

Closes #2633
Original Pull Request: #2637
2023-07-12 13:53:03 +02:00
Mark Paluch
9fe32d521e Polishing.
Refine documentation about auto-startup. Set phase to zero to be in the middle between min and max.

See #2635
Original pull request: #2636
2023-07-12 10:43:15 +02:00
Christoph Strobl
d98afb9154 Start RedisConnectionFactory through afterPropertiesSet.
This commit restores the behaviour of RedisConnectionFactories eager initialization via afterPropertiesSet.
Additionally it is now possible to modify the lifecycle phase.

Closes #2635
Original pull request: #2636
2023-07-12 10:42:26 +02:00
Christoph Strobl
d25de89fec Polishing.
Stick to TtlFunction & nullability contracts.
Update deprecation with since tag.

Original Pull Request: #2597
2023-07-11 14:50:33 +02:00
John Blum
fe88d31d09 Reinstate RedisCacheConfiguration.getTtl().
Reintroduce and deprecate RedisCacheConfiguration.getTtl for backwards compatibility.

Closes #2628
Original Pull Request: #2597
2023-07-11 14:49:26 +02:00
Mark Paluch
65f628ab76 Polishing.
Reorder factory fields according to immutable configuration, mutable configuration and connection factory state. Reorder methods and switch Jedis references to its current GitHub repository.

Refine assertions. Update documentation.

See: #2503
Original pull request: #2627
2023-07-10 16:27:17 +02:00
Christoph Strobl
908a4d0d8a Migrate RedisConnectionFactory to Lifecycle beans.
Closes: #2503
Original pull request: #2627
2023-07-10 16:27:16 +02:00
John Blum
adba001f74 Simplify RedisClient and LettuceConnectionProvider creation.
Closes #2621
2023-06-27 13:35:04 -07:00
John Blum
647e48742a Make use of pattern variable in equals(:Object) method.
Closes #2621
2023-06-26 17:21:50 -07:00
John Blum
4637323c80 Edit Javadoc in RedisConnection.
Closes #2586
2023-06-26 17:18:05 -07:00
John Blum
c863f9b914 Rename RedisAssertions.requiredObject(..) to requireNonNull(..).
Closes #2621
2023-06-26 16:27:07 -07:00
John Blum
8f58c1f27c Polish.
Pull request: #2525
2023-06-14 19:59:48 -07:00
daihuabin
1d293d85a3 Use BitSet instead of LinkedHashSet to improve the performance of SlotRange construction.
Pull request: #2525
2023-06-14 19:58:43 -07:00
John Blum
2b2e050004 Add requireState(..) assertion method to RedisAssertions.
Use RedisAssertions.requireState(..) in RedisAccessor.getRequiredConnectionFactory().

Closes #2611
2023-06-14 14:27:17 -07:00
John Blum
f3de2d51dc Allow users to customize the internal ObjectMapper created by GenericJackson2JsonRedisSerializer.
We now allow the internally created Jackson ObjectMapper to be customized and further configured after construction of the GenericJackson2JsonRedisSerializer when a user does not explicitly provide a custom ObjectMapper during construction. Even when providing a custom ObjectMapper, not all configuration applied by the GenericJackson2JsonRedisSerialzier (such as (standard) type resolution) to the internal ObjectMapper would get applied to the user-provided ObjectMapper as well.

Closes #2601
2023-06-14 13:41:19 -07:00
John Blum
f1492e1790 Refactor JdkSerializationRedisSerializer.
* Annotate deserialize(..) with @Override.
* Cleanup source code.
* Edit Javadoc.

Closes #2610
2023-06-14 12:55:32 -07:00
John Blum
4da3bdf798 Refactor GenericJackson2JsonRedisSerializer.
* Cleanup and simpifly source code.
* Fix compiler warnings.
* Edit Javadoc.

Closes #2609
2023-06-14 12:16:40 -07:00
John Blum
433bb89d9b Fix missing/misplacement of <p> tag in Jackson2HashMapper Javadoc.
Resolves #2586
2023-06-14 09:42:52 -07:00
John Blum
f8a9fdf372 Polish.
* Cleanup source code in Jackson2HashMapper; Edit Javadoc.
* Add test cases for the un/flattened mapping of an Object with a timestamp (LocalDateTime) as provided by the user in Issue #2593.

Closes #2593
2023-06-12 13:35:43 -07:00
Christoph Strobl
637964eed8 Fix Jackson (hash) mapping for BigDecimal/BigInteger scalar values and Java Time types.
Once again, the SD Redis Jackson2HashMapper can now de/serialize Objects with BigDecimal/BigInteger values along with java.time types, such as java.time.LocalDateTime.

Additionally, splits the unit tests for flattening and unflattening of the hash mapping into 2 separate test classes to be picked up in the SD Redis test suite.

Resolves #2593
2023-06-12 13:35:37 -07:00
John Blum
770fbac670 Review and polish for confiuring a cache lock TTL.
Closes #2300
Pull request: #2597.
2023-06-12 13:02:15 -07:00
Mark Paluch
9aa2eb4b02 Allow configuration of cache lock TTL.
RedisCacheWriter now can now issue locks that expire using TtlFunction to prevent eternal locks.

Closes #2300
Pull request: #2597
2023-06-12 12:38:51 -07:00
Mark Paluch
14571a5569 Polishing.
Reformat code. Fix typo.

See #2591
Original pull request: #2592
2023-06-08 16:21:10 -07:00
Yanming Zhou
734a359e6a Construct LettuceObservationContext with parent observation
After this commit, LettuceObservationContext.setParentObservation() is called right after Context rather than Observation created, then Context.getParentObservation() could be used in ObservationPredicate to determine whether Observation should be created.

Fixes #2591
Original pull request: #2592
2023-06-08 16:21:05 -07:00
Mark Paluch
a3cb205060 Fix ZAddArgs.isEmpty.
isEmpty now returns true if empty. Previously, the boolean returns were flipped.

Closes #2588
2023-06-08 16:21:00 -07:00
Mark Paluch
3ba75d2aad Use OBJECT, PTTL, and RESTORE JedisCluster methods directly.
We now use directly JedisCluster methods instead of using our command executor routing as JedisCluster exposes the methods and we no longer require our own command routing.

Closes #2589
2023-06-08 16:20:42 -07:00
John Blum
050beebc74 Edit and cleanup Javadoc.
Resolves #2586
2023-05-23 11:03:46 -07:00
John Blum
2246a98a93 Polish.
Additionally, refactors and cleans up the Redis cache extension and infrastructure.

Closes #2583
2023-05-18 17:14:41 -07:00
Yanming Zhou
9f98f0d5fa Improve RedisCacheManagerBuilder to expose applied RedisCacheConfiguration.
Now it is possible to construct a new, custom default RedisCacheConfiguration from an existing, default RedisCacheConfiguration.

This is useful in a Spring Boot context using the RedisCacheManagerBuilderCustomizer and acquiring access to the default RedisCacheConfiguration, which likely originated from Spring Boot Redis CacheProperties.

Resolves #2583
2023-05-18 17:13:54 -07:00
Mark Paluch
5e8f73a00a Make LettuceObservationContext public to use it with Observation Predicates.
Close #2550
2023-05-09 15:13:33 +02:00
Mark Paluch
8c9af9d46a Polishing.
Delegate RedisClientProvider.getClient() across connection providers. Use SimpleAsyncTaskExecutor as default in ClusterCommandExecutor to avoid ThreadPoolTaskExecutor pollution.

See #2575
2023-05-09 15:04:51 +02:00
Mark Paluch
aadfae62a4 Pass Page.size() to GEORADIUS COUNT.
We now reuse the page size to initially limit Geo results within Redis.

Closes #1242
2023-05-08 14:11:02 +02:00
John Blum
a147385431 Fix element ordering issue on a mapped de/serialized entity having List property.
Closes #2565
2023-05-07 11:49:18 -07:00
Wonchul Heo
c7f51a2073 Fix typo.
Original pull request #2567
2023-05-03 10:48:18 +02:00
Mark Paluch
56c633c3a9 Fix BoundingBox.width return value.
We now return the correct value.

Closes #2526
2023-04-24 14:45:55 +02:00
remeio
2692aafc63 Tweak Javadoc wording of mergeArrays.
Closes #2558
2023-04-24 14:11:56 +02:00
Alexander Münch
6316609fbf Fix Javadoc in RedisCacheConfiguration.
The prefixCacheNameWith() method returns a new instance, not `this`.

Closes #2539
2023-04-03 07:41:58 -07:00
John Blum
7e1746cc2a Polish.
Closes #2466

See #2465
2023-03-02 19:13:08 -08:00
Marcin Zielinski
992905360b Add support for XCLAIM in StreamOperations
Closes #2465
2023-03-02 19:13:02 -08:00
John Blum
149037d5d5 Replace TODO comment with Issue ticket changing RedisAccessor to abstract.
See #2494
See #2493
2023-01-24 09:42:18 -08:00
John Blum
b958756d15 Annotate indexOf(..) and lastIndexOf(..) ListOperations with @Nullable.
Closes #2488
2023-01-19 16:58:53 -08:00
John Blum
e4c4c7e040 Refactor RedisAccessor.
* Annotate API with missing Spring @NonNull and @Nullable annotations.
* Redefine afterPropertiesSet() in terms of getRequiredConnectionFactory().
* Edit Javadoc.

Closes #2493
2023-01-19 16:15:45 -08:00