Commit Graph

1017 Commits

Author SHA1 Message Date
Mark Paluch
fc8ba1aa84 Polishing.
Consistently use InvalidDataAccessApiUsageException to signal that an operation is not allowed/supported in the current mode of operation.
Replace converter objects with conversion within the actual method to remove indirections.

Original Pull Request: #2287
2022-05-18 13:37:01 +02:00
Mark Paluch
f232a5b3fe Polishing.
Reformat code. Reduce visibility, simplify code.

Original Pull Request: #2287
2022-05-18 13:35:38 +02:00
Mark Paluch
1e4cd6f341 Upgrade to Jedis 4.2.
The upgrade also allows to enable support for GEOSEARCH, GEOSEARCHSTORE, XCLAIMJUSTID and XPENDING.

Closes: #2212
Original Pull Request: #2287
2022-05-18 13:35:01 +02:00
Mark Paluch
5f75eab65e Attempt early usage of custom converters.
We now try to eagerly apply a custom converter when reading Redis properties in the MappingRedisConverter before considering type hints from the hash.

We require type hints to properly restore the target type for a hash entry as Redis data is all byte arrays, so a simple String needs a type hint before we can load it back into an e.g. Object-typed property. Subtypes of properties (such as ZoneRegion for ZoneId) are sometimes not associated with a converter as only the parent type (ZoneId) is associated with a converter. Trying to convert the value into the subtype directly through our ConversionService would fail in that case.

Closes #2307
2022-04-20 15:16:50 +02:00
Mark Paluch
e0f49370d9 Correctly return connection future from StaticMasterReplicaConnectionProvider.
We now pass on the connection future when connecting through StaticMasterReplicaConnectionProvider.getConnectionAsync(…).

Closes #2296
2022-04-06 14:21:46 +02:00
Mark Paluch
84820c4e17 Polishing.
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
2022-03-31 10:11:08 +02:00
helei01_gza
5ce30f0df4 Eagerly return null values in AbstractOperations.deserializeGeoResults(…) to avoid null dereference.
Closes #2279
Original pull request: #2280.
2022-03-31 10:11:07 +02:00
Mark Paluch
0e847a3da8 Polishing.
Reformat code. Refine tests as we do not require assertions for every publish command when testing listeners.

See #2209
Original pull request: #2225.
2022-03-31 09:31:27 +02:00
Vedran Pavic
178d44c5f1 Update RedisOperations#convertAndSend to return number of clients receiving the message.
Currently, `RedisOperations#convertAndSend` is void event though the underlying `RedisPubSubCommands#publish` returns a `Long` that represents the number of clients receiving the published message (see https://redis.io/commands/publish).

This commit updates `RedisOperations#convertAndSend` to return the number of clients that received the message.

Closes #2209
Original pull request: #2225.
2022-03-31 09:31:16 +02:00
Mark Paluch
d76c5be7da Polishing.
Tweak Javadoc. Make tests less strict for random values test.

Original Pull Request: #2276
2022-03-17 15:59:09 +01:00
Mark Paluch
4fdb5fd50f Introduce executeWithoutResult(…) method.
Original Pull Request: #2276
2022-03-17 15:59:09 +01:00
Mark Paluch
f5715446c8 Introduce doWithKeys.
Original Pull Request: #2276
2022-03-17 15:59:09 +01:00
Mark Paluch
19d1f52f0a Reorder methods.
See: #2273
Original Pull Request: #2276
2022-03-17 15:59:08 +01:00
Mark Paluch
f5af2cf468 Replace Bound…Operations implementation with a proxy factory.
Original Pull Request: #2276
2022-03-17 15:59:08 +01:00
Mark Paluch
33e8974578 Refine defaulted connection arrangement.
DefaultedRedis…Connection is now deprecated to help with migration towards segregated/commands interface usage. The connection now exposes a commands() object providing access to RedisCommands so that a composite commands object can be accessed independently from the connection.

Redis…Commands provider represent entry points to obtain segregated command interfaces.

See: #2273
Original Pull Request: #2276
2022-03-17 15:59:08 +01:00
Mark Paluch
f6eaa40019 Polishing.
StreamInfo subtypes now implement Streamable. Switch from stream mapping to for/each style to avoid Java Stream creation.

Introduce getRequired(…) methods to improve nullability experience.

Original Pull Request: #2276
2022-03-17 15:59:08 +01:00
Mark Paluch
5c4c9e029f Remove deprecated API.
See: #2273
Original Pull Request: #2276
2022-03-17 15:58:57 +01:00
Mark Paluch
b45d358abf Move Tuple, Limit, and Weights to top-level types.
See: #2273
Original Pull Request: #2276
2022-03-17 15:58:46 +01:00
Mark Paluch
91cfbf5470 Remove deprecated LettucePool and deprecated methods.
See: #2273
Original Pull Request: #2276
2022-03-17 15:58:22 +01:00
Mark Paluch
f1d528ffef Remove usage of oppressive language.
The API exposes now the renamed command terminology (replica) only and no longer the deprecated one.

Closes: #2195
See: #2274
Original Pull Request: #2276
2022-03-17 15:56:50 +01:00
Mark Paluch
69205c56bb Polishing.
Update Bound operations parameter documentation order. Tweak wording.

See #2214
2022-03-10 13:53:15 +01:00
zhenqiangyi
3cf420a8d4 Fix parameter documentation order of ZSetOperations methods.
Closes #2214
2022-03-10 13:53:15 +01:00
Mark Paluch
f19a61452a Polishing.
Update since tags. Move FlushOption converters to client-specific converters. Use method-references where possible.

See #2187
Original pull request: #2190.
2022-03-10 10:47:00 +01:00
Napster
3191def956 Add support for flush modes using FLUSHDB and FLUSHALL commands.
Closes #2187
Original pull request: #2190.
2022-03-10 10:46:58 +01:00
Mark Paluch
b895229f7c Polishing.
Avoid races in command unsubscribe fetching.

See #2226
2022-03-09 13:52:55 +01:00
dengliming
5e23f1c4de Simplify CLUSTER MYID command for Jedis.
Closes #2226
2022-03-09 13:51:02 +01:00
Mark Paluch
c63e2e2900 Polishing.
Add support for MINID trimming. Add tests. Extract Jedis XAddParams conversion to StreamConverters.

Reorder methods. Simplify StreamRecord creation.

See #2247
2022-03-09 10:29:28 +01:00
dengliming
9b8bca689a Support for approximate trimming in XAddOptions and AddStreamRecord.
Closes #2247
2022-03-09 09:46:27 +01:00
Mark Paluch
e31d122e54 Polishing.
Add since tags. Consistently document scan command with try-with-resources guidance. Use try-with-resources in tests.

See #2260
Original pull request: #2263.
2022-02-23 15:30:06 +01:00
Chen Li
04165fb747 Support scan in RedisTemplate.
Closes #2260
Original pull request: #2263.
2022-02-23 15:30:04 +01:00
Mark Paluch
d34c45bfe4 Polishing.
Allow Jedis to exist pub/sub loop gracefully. Await unsubscribe. Reduce retry backoff to allow from broken connection recovery. Do not use pooling to avoid using broken connections.

See #2256
2022-02-17 16:24:50 +01:00
Christoph Strobl
bc07540b9a Update copyright year to 2022.
See: #2264
2022-02-17 11:39:38 +01:00
Christoph Strobl
f6b21315a7 MessageListenerContainer must not be initialized twice.
Error when afterPropertiesSet is called more than once. Update documentation and error messages.
Original Pull Request: #2256
2022-02-17 11:38:25 +01:00
Mark Paluch
5681ddce68 Use proper subscribe methods and fix nullability assumptions.
See: #964
Original Pull Request: #2256
2022-02-17 11:38:18 +01:00
Mark Paluch
5959efb3af Revise implementation of RedisMessageListenerContainer.
RedisMessageListenerContainer is now reimplemented using non-blocking synchronization guards and a state management to simplify its maintenances. Additionally, listener registration and subscription setup through the start() method awaits until the listener subscription is confirmed by the Redis server. The synchronization removes potential race conditions that could happen by concurrent access to blocking Redis connectors in which the registration state was guessed and not awaited.

Resolves: #964
Original Pull Request: #2256
2022-02-17 11:37:57 +01:00
Oliver Drotbohm
14da2582a0 Adapt to changes in entity creation metadata APIs in Spring Data Commons. 2022-02-15 17:40:53 +01:00
Jens Schauder
577e3337fa Remove Eclipse Non-Javadoc comments.
Closes #2223
2022-01-13 14:50:01 +01:00
Mark Paluch
9732c64024 Polishing. 2022-01-13 14:50:01 +01:00
Mark Paluch
10d8ca2a08 Migrate to Jakarta EE 9.
Closes #2172
2022-01-13 14:50:01 +01:00
Christoph Strobl
93c25b0608 Switch Jackson default mapping default from NON_FINAL to EVERYTHING.
Closes #1566
Original pull request: #2237.
2022-01-13 14:48:50 +01:00
Mark Paluch
d0f17b167e Polishing.
Reformat code. Consider sentinel username in JedisConnectionFactory. Update years in license headers.

See #2218
Original pull request: #2224.
2022-01-07 11:05:19 +01:00
Vikas Garg
f333b184a5 Support sentinel username in SentinelConfiguration.
Closes #2218
Original pull request: #2224.
2022-01-07 11:05:04 +01:00
Mark Paluch
45fdc5d0ab Polishing.
Consider configured PolymorphicTypeValidator.

See #2211
2022-01-03 10:49:32 +01:00
Guirong Hu
9af0f5f996 Move off deprecated ObjectMapper methods.
Closes #2211
2022-01-03 10:49:11 +01:00
Mark Paluch
3ca2191445 Respect ByteBuffer position and limits in ByteUtils.getBytes(ByteBuffer).
We now properly extract the byte array from a ByteBuffer by copying its content respecting the read position and limits.

Closes #2204
Original Pull Request: #2213
2021-12-15 09:52:49 +01:00
Mark Paluch
9a56c38e2c Return single-element list with empty value when ReactiveHashOperations.hMGet(…) for a single key returns no value.
We now return a list containing a single empty KeyValue element when ReactiveHashOperations.hMGet(…) called for a single key returns no value.

Previously, the code used onErrorReturn(…) which returned the wrong value and suppressed errors.

Closes #2210
2021-12-10 10:03:02 +01:00
Mark Paluch
518fd6d946 Avoid cast to StatefulRedisConnection upon eager LettuceConnectionFactory initialization.
We now no longer try to cast the Lettuce connection to StatefulRedisConnection when eagerly initializing the shared connection. Instead, we now introduced another method to obtain the cluster connection.

Closes #2186
2021-11-12 08:52:28 +01:00
Mark Paluch
b2f7b6f4b2 Polishing.
Rename key name arguments consistently to oldKey/newKey.

See #2189
2021-11-08 15:23:55 +01:00
Todd Merrill
b67f1339b2 Use consistent key names in RENAME/RENAMENX command documentation.
Closes #2189
2021-11-08 15:23:27 +01:00
Forever杨
954029d64a Fix command reference in Javadoc.
Closes #2176
2021-10-13 14:25:01 +02:00