Commit Graph

616 Commits

Author SHA1 Message Date
Mark Paluch
15fd1d38de DATAREDIS-588 - Polishing.
Simplify SET command usage with Jedis using various expiry and presence/absence flags to use consistently SetParams.

Original Pull Request: #463
2019-07-30 07:50:40 +02:00
Mark Paluch
9118af48a5 DATAREDIS-1013 - Polishing.
Remove flakey tests.
2019-07-26 14:55:37 +02:00
Mark Paluch
2de4141514 DATAREDIS-1013 - Polishing.
Add test. Consider grammar depending on argument count.

Original pull request: #468.
2019-07-26 14:49:07 +02:00
Mark Paluch
485ee1d5a2 DATAREDIS-549 - Polishing.
Replace some AtTest(expected = …) and ExpectedException with the corresponding AssertJ assertThatExceptionOfType(…) and assertThatIllegalArgumentException().isThrownBy(…).
2019-07-10 17:57:38 +02:00
Mark Paluch
0205c9c98b DATAREDIS-549 - Migrate to AssertJ. 2019-07-10 17:57:38 +02:00
Mark Paluch
e506691f70 DATAREDIS-1001 - Polishing.
Use untyped serializers/serializers for Calendar and Date. Serialize JSR-310 types to String.

Original pull request: #467.
2019-07-09 16:44:57 +02:00
Christoph Strobl
a2831bef84 DATAREDIS-1001 - Fix java.util.Date hash mapping when flattening out entries.
The AsArrayTypeDeserializer causes date values to be rendered as an array like [java.util.Date, 1561543964015] an therefore is 1. skipped when flattening and 2. if not skipped cannot be read back.
We now register an error handler along with a custom deserializer aware of the used date format to write and read date values without having to store an array but just the date msec.

Original pull request: #467.
2019-07-09 16:33:33 +02:00
Christoph Strobl
1bdf875d45 DATAREDIS-976 - Polishing.
Add missing nullable annotations.

Original pull request: #457
2019-07-03 11:49:16 +02:00
Mark Paluch
05798fb637 DATAREDIS-976 - Allow extension of Lettuce Connection and Subscription classes.
LettuceConnection, LettuceClusterConnection, and LettuceSubscription can now be properly subclassed so they can be extended and created by LettuceConnectionFactory.

LettuceConnectionFactory provides template methods doCreateLettuceConnection and doCreateLettuceClusterConnection.

Original pull request: #450 & #457
2019-07-03 11:11:49 +02:00
Mark Paluch
6d4be98ce1 DATAREDIS-976 - Add Pub/Sub tests for Redis Cluster.
Original pull request: #450 & #457
2019-07-03 11:11:11 +02:00
Mark Paluch
ad54341953 DATAREDIS-990 - Propagate SSL configuration to Lettuce driver when using Redis Sentinel.
We now appropriately set SSL configuration when using the Lettuce driver with Redis Sentinel to enable Sentinel usage with SSL. Using Sentinel with SSL requires Lettuce 5.2 or newer.

Original Pull Request: #462
2019-07-03 09:48:04 +02:00
Christoph Strobl
64b8913764 DATAREDIS-988 - Polishing.
Original Pull Request: #453
2019-07-03 08:19:11 +02:00
Mark Paluch
ae2042b1eb DATAREDIS-988 - Consider transaction participation when releasing connections.
We now consider RedisTemplate's enableTransactionSupport configuration when releasing connections. Previously, we released bound connections when being in a read-only transaction regardless the configuration in RedisTemplate. This broke session callbacks that expected to remain on the same connection all but the first command were executed on a different connection.

Releasing a connection now no longer unbinds a connection if transaction support is disabled.

Original Pull Request: #453
2019-07-03 08:15:02 +02:00
Mark Paluch
da1de92645 DATAREDIS-988 - Discard transactions when releasing pooled connections.
We now check on connection release whether a connection is in MULTI state. If so, then we discard (rollback) the transaction to reset the connection to a fresh state.

Original Pull Request: #453
2019-07-03 08:03:19 +02:00
Mark Paluch
dfa366d8f7 DATAREDIS-999 - Use UsingWhen to apply functions to reactive Redis connections.
We now use Flux.usingWhen() to apply functions on reactive Redis connections and to release connections calling non-blocking methods.

Original Pull Request: #461
2019-07-02 13:52:52 +02:00
Mark Paluch
e9b5e6ee8e DATAREDIS-1005 - Polishing.
Implement cluster-wide scriptFlush(), scriptKill(), and scriptLoad(). Add method argument assertions and author tags. Adapt and fix tests.

Original pull request: #460.
2019-07-02 10:56:31 +02:00
Pavel Khokhlov
988a7e71b7 DATAREDIS-1005 - Add support for scripting commands for Jedis Cluster.
Original pull request: #460.
2019-07-02 10:54:10 +02:00
Mark Paluch
755a78c210 DATAREDIS-639 - Unify logging framework usage.
Move off SLF4J to Commons Logging for code that used SLF4J.

Original pull request: #248.
2019-06-18 12:08:03 +02:00
Mark Paluch
f77eccbc16 DATAREDIS-993 - Polishing.
Original pull request: #455.
2019-06-18 11:51:27 +02:00
Romain Beghi
548d8e7545 DATAREDIS-993 - Fix StreamOperations MapRecord HashValue serialization.
We now use the appropriate serializer to serialize hash values.

Original pull request: #455.
2019-06-18 11:51:02 +02:00
Christoph Strobl
1ca6659ef4 DATAREDIS-973 - Polishing.
Use connection factory customizer for setting db index when creating new connection. This allows to grasp the tests setup more quickly and improves readability.

Original Pull Request: #451
2019-06-06 07:31:39 +02:00
Mark Paluch
06e368b430 DATAREDIS-973 - Fix database selection using Lettuce.
We now correctly set the requested database using RedisURI so the driver performs the database selection. We no longer need to call select ourselves.

For shared connections (pooled and single shared connection) we now no longer call select. This can leave connections with a different database associated.

Original Pull Request: #451
2019-06-05 12:37:40 +02:00
Mark Paluch
e4446697cd DATAREDIS-955 - Polishing.
Eliminate warnings. Formatting. Remove test without assertions.

Original pull request: #452.
2019-05-21 14:38:34 +02:00
Christoph Strobl
db2e3bcae6 DATAREDIS-955 - Fix collection initialization when reading nested structures with same name.
We now make sure to not falsely populate instances with null values from nested structures.

Original pull request: #452.
2019-05-21 14:38:23 +02:00
Mark Paluch
f13056c385 DATAREDIS-981 - Fix conversion of unlimited Limit objects for Lettuce.
We now use the proper Limit.unlimited() factory method for unlimited Limits.
2019-05-13 10:03:11 +02:00
Mark Paluch
e0a059f96b DATAREDIS-972 - Polishing.
Add author tags. Reformat code. Split test for exceptions into two methods.

Original pull request: #448.
2019-04-29 12:19:15 +02:00
Oscar Cai
051b1ee820 DATAREDIS-972 - Fix validation for RedisCommand argument count.
Original pull request: #448.
2019-04-29 12:18:35 +02:00
Mark Paluch
647cf25d2b DATAREDIS-956 - Polishing.
Add author tags. Provide override for clientName(…) in LettucePoolingClientConfigurationBuilder. Extend Javadoc. Add and simplify tests.

Original pull request: #446.
2019-04-18 11:41:02 +02:00
longlong.zhao
e3b903ce36 DATAREDIS-956 - Add readFrom(…) override to LettucePoolingClientConfigurationBuilder.
Original pull request: #446.
2019-04-18 11:38:30 +02:00
Mark Paluch
f2a0623d6e DATAREDIS-971 - Polishing.
Add test. Use primitive types instead of wrappers for signed flag. Add author tag.

Original pull request: #447.
2019-04-17 15:33:02 +02:00
Mark Paluch
5cd8bb8e27 DATAREDIS-953 - Release connection after failed validation only once.
We now release a connection after a failed validation only once. Previously, a connection was released twice which caused a failure if the connection was obtained from a pool.

Original Pull Request: #445
2019-03-27 10:38:57 +01:00
Mark Paluch
138198fd0f DATAREDIS-950 - Fix ClassCastException on shared Lettuce Cluster connection validation.
Original Pull Request: #445
2019-03-27 10:30:13 +01:00
Christoph Strobl
70cb773afe DATAREDIS-925 - Add and register binary read/write converter for UUID.
Original pull request: #444.
2019-03-27 09:22:02 +01:00
Mark Paluch
34bcd46620 DATAREDIS-794 - Improve Jedis Cluster Topology caching.
We now made JedisClusterTopologyProvider public and configurable through overriding JedisConnectionFactory.createTopologyProvider(…).

The topology provider accepts a configurable timeout to configure the cache timeout. Alternatively, custom ClusterTopologyProvider implementations can be returned through JedisConnectionFactory.createTopologyProvider(…).

Original Pull Request: #383
2019-03-26 13:47:48 +01:00
Christoph Strobl
a0e3dca1e4 DATAREDIS-949 - Polishing.
Favor AssertJ over Hamcrest.

Original Pull Request: #417
2019-03-26 09:52:07 +01:00
Mark Paluch
50818fbb32 DATAREDIS-949 - Consider max-redirects using Lettuce.
LettuceConnectionFactory now considers the maximal redirection limit for Redis Cluster redirections.

Previously, the max-redirects limit was not configured in Lettuce.

Original Pull Request: #417
2019-03-26 09:51:40 +01:00
Spring Operator
2eb7067e8c DATAREDIS-948 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 763 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).

Original Pull Request: #442
2019-03-22 10:22:27 +01:00
Oliver Drotbohm
77f6582aee DATAREDIS-944 - Move off deprecations in Spring Data Commons.
Related ticket: DATACMNS-1496.
2019-03-14 14:19:54 +01:00
Christoph Strobl
0a4d6222e6 DATAREDIS-888 - Polishing
Original Pull Request: #384
2019-02-28 11:31:54 +01:00
Mark Paluch
22fdaba350 DATAREDIS-888 - Use Lettuce's read-only Partition view for node conversion.
We now use the read-only view of Lettuce's Partition object to convert Lettuce RedisClusterNode objects into Spring Data RedisClusterNode. The read-only view is atomic and does not require external synchronization.

Original Pull Request: #384
2019-02-28 11:31:32 +01:00
Christoph Strobl
630ff46b45 DATAREDIS-935 - Allow configuration of a single initial cache in RedisCacheManagerBuilder.
Also, add introspection methods to expose the configured cache names/configurations.

Original pull request: #387.
2019-02-27 15:19:19 +01:00
Mark Paluch
2622f054ab DATAREDIS-930 - Polishing.
Add since tags. Simplify test using Lombok annotations. Reformat code.

Original pull request: #385.
2019-02-15 11:09:38 +01:00
Luis De Bello
34951495ba DATAREDIS-930 - Return port/host of WithHostAndPort configurations using LettuceConnectionFactory.getPort() and getHost().
We now correctly return host and port from configurations that implement WithHostAndPort instead of always using RedisStandaloneConfiguration.

Original pull request: #385.
2019-02-15 11:08:08 +01:00
Mark Paluch
62e48be873 DATAREDIS-918 - Enable Lettuce's global timeouts by default.
LettuceClientConfiguration now enables Lettuce's global timeouts by default to enable timeouts using the reactive API. This change prevents hanging Redis commands due to a blocked connection or when Redis is down. Timeouts are enabled through defaulting so setting ClientOptions or ClusterClientOptions overrides this behavior.

Original Pull Request: #381
2019-01-09 13:38:29 +01:00
Mark Paluch
f253d4128d DATAREDIS-749 - Polishing.
Upgrade to Jedis 3.0. Remove reflective sendCommand calls in favor of public Jedis sendCommand API. Invocations with null arguments by introducing overloads with argument defaulting. Fix exception translation because of a changed exception hierarchy. Fix tests and adapt tests to new transactional results that return null values instead if empty collections for nested array responses.

Reformat code. Add author tags. Add note to reference docs.

Original pull request: #374.
2019-01-08 09:37:34 +01:00
Guy Korland
f4680a180c DATAREDIS-749 - Upgrade to Jedis 3.0.0 M1.
Upgrade dependency version to 3.0.0 M1. Adapt to API changes.

Original pull request: #374.
2019-01-08 09:37:31 +01:00
Mark Paluch
3a07a0d8ed DATAREDIS-917 - Update copyright years to 2019. 2019-01-02 14:16:01 +01:00
Mark Paluch
7ec4641cc1 DATAREDIS-913 - Delete multiple keys through ReactiveRedisTemplate.delete(Publisher) and unlink(Publisher).
We now delete all keys that are emitted by the source publisher when invoking delete(Publisher) and unlink(Publisher). Both methods split incoming keys into chunks of 128 keys to keep a balance between latency and the issued command count.

Previously, delete(Publisher) and unlink(Publisher) only deleted the first key.

Original Pull Request: #379
2018-12-20 09:42:43 +01:00
Mark Paluch
d248c0cd7c DATAREDIS-909 - Fix constructor creation of entities with collection-typed properties.
We now consider the property type in value conversion for constructor arguments to provide the appropriate value type. Previously, we considered the component type which converted a Collection<T> to a single T that caused downstream ClassCastException.

Original Pull Request: #378
2018-12-20 08:54:12 +01:00
Mark Paluch
1f4bb973ea DATAREDIS-865 - Expose GenericJackson2JsonRedisSerializer.registerNullValueSerializer() for ObjectMapper customization.
We now expose registerNullValueSerializer(…) on GenericJackson2JsonRedisSerializer to allow customization of an externally provided ObjectMapper. NullValueSerializer was previously registered only within a constructor that takes classPropertyTypeName and provided no further possibilities to customize ObjectMapper.

Code wishing to provide a custom ObjectMapper can now call GenericJackson2JsonRedisSerializer.registerNullValueSerializer(objectMapper, …) and perform additional customizations before using ObjectMapper with GenericJackson2JsonRedisSerializer.

Original Pull Request: #376
2018-12-20 08:35:30 +01:00