Commit Graph

411 Commits

Author SHA1 Message Date
Spring Operator
364a7b4e94 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 511 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: #420
2019-03-22 10:13:12 +01:00
Mark Paluch
094e3790d1 DATAREDIS-939 - Polishing.
Reformat code. Slightly tweak test.

Original pull request: #388.
2019-03-04 16:24:07 +01:00
Dmytro Liash
3d35132dc7 DATAREDIS-939 - Add timeout to Lettuce RedisURI when using Sentinel.
Original pull request: #388.
2019-03-04 16:23:51 +01:00
Mark Paluch
9e82cb4ea8 DATAREDIS-917 - Update copyright years to 2019. 2019-01-02 14:18:19 +01:00
Mark Paluch
6b3cb791a9 DATAREDIS-872 - Polishing.
Create unit tests for RedisAtomic counter initialization. Refactor setIfAbsent(…) method to initializeIfAbsent() to not expose additional API methods.

Original pull request: #367.
2018-10-19 12:48:30 +02:00
Christoph Strobl
ee8c17a4e9 DATAREDIS-840 - Polishing.
Introduce dedicated Subscription.close() to unsubscribe() and punsubscribe().

Original Pull Request: #346
2018-06-12 13:10:03 +02:00
Mark Paluch
ffe3e927e5 DATAREDIS-840 - Polishing.
Fix code comment. Reformat code.

Original Pull Request: #346
2018-06-12 11:17:50 +02:00
Mark Paluch
cc27ae2d9e DATAREDIS-840 - Catch unsubscribe exceptions when stopping RedisMessageListenerContainer.
We now catch exceptions that may occur during unsubscription from the subscribed patterns/channels.
Previously, RuntimeExceptions were not caught and prevented a fast shutdown of the ApplicationContext.

Original Pull Request: #346
2018-06-12 11:03:35 +02:00
Mark Paluch
68fca92295 DATAREDIS-822 - Consider argument range in RedisCommand min/max arguments specification.
We now consider max argument specifications as upper bound and no longer as the exact number of required arguments.

Original pull request: #335.
2018-05-02 14:49:07 +02:00
Mark Paluch
29519d99c3 DATAREDIS-623 - Polishing.
Add author tags. Slightly tweak test.

Original pull request: #330.
2018-04-12 10:01:10 +02:00
Zhongning Fan
f61b0d6fad DATAREDIS-623 - Fix RedisQueryEngine.count(…) with proper SINTER/SUNION usage.
Backport of RedisQueryEngine#count(RedisOperationChain, Serializable) fix using multiple indexed keys.

Related ticket: DATAREDIS-605.
Original pull request: #330.
2018-04-12 10:01:10 +02:00
Christoph Strobl
ab5375802e DATAREDIS-790 - Polishing.
Add unit tests.

Original Pull Request: #291.
Original ticket: DATAREDIS-714.
2018-03-15 10:30:58 +01:00
Mark Paluch
99b18c4ca5 DATAREDIS-790 - Use Jedis API for database selection.
We now rely more on Jedis to select the appropriate Redis database and we no longer select the database when opening/closing a connection. Previously, we always reset the database if a database index greater zero was configured.
A properly configured Jedis pool ensures that the appropriate database is selected even if the database was selected during connection interaction.

Relying on Jedis reduces the number of issued SELECT commands and improves that way overall performance when executing commands via the Template API.

Original Pull Request: #291.
Original ticket: DATAREDIS-714.
2018-03-15 10:29:24 +01:00
Christoph Strobl
90c86a533a DATAREDIS-768 - Polishing.
Added test with decimal and date map keys to verify those are flattened out correctly using the converters registered and updated documentation to point out limitation of map keys to simple types.

Original Pull Request: #312
2018-02-16 13:00:41 +01:00
Mark Paluch
0fd0c8c213 DATAREDIS-768 - Consider map key type in MappingRedisConverter.readMap…(…).
We now consider the key type when reading a map from a Redis Hash. Previously, map keys were read as string while a map could declare numeric keys.

Original Pull Request: #312
2018-02-16 11:17:40 +01:00
Mark Paluch
5268549710 DATAREDIS-673 - Prevent false positive cache hits while Redis keys expire.
We now prevent false positive cache hits after checking for key presence and the Redis key gets removed before fetching its value.
This can happen if we check positively for presence but the key expires (TTL) or gets removed before the GET call is able to fetch the value.

Previously, we returned a RedisCacheElement wrapping null without regard to whether the cache is able to store/return null values. We now inspect the returned value for presence to eagerly return a negative cache hit and to preserve cached null values.

Original Pull Request: #310
2018-02-12 08:37:25 +01:00
Mark Paluch
434b9e369d DATAREDIS-766 - Configure SSL usage in JedisConnectionFactory depending on JedisShardInfo.
We now enable/disable SSL usage when configuring JedisConnectionFactory with JedisShardInfo based on the configured SSL use in JedisShardInfo.

Original Pull Request: #308
2018-02-05 09:37:33 +01:00
Mark Paluch
404a66f437 DATAREDIS-765 - Enable pooling when configuring Jedis to use Redis Sentinel.
We now enable pool usage when configuring JedisConnectionFactory with RedisSentinelConfiguration to prevent accidental connections using the non-pooled standalone configuration. Jedis can operate with Sentinel only with pooling.

We also reject calls to disable pooling when JedisConnectionFactory is configured to use Sentinel.

Original Pull request: #307
2018-02-01 15:27:23 +01:00
Mark Paluch
f8f422f948 DATAREDIS-759 - Fix line endings to LF. 2018-01-24 13:04:01 +01:00
Mark Paluch
f79d292142 DATAREDIS-756 - Order results of partitioned multi-key commands by positional keys.
We now order and assemble results of multi-key commands (e.g. MGET with cross-slot keys) that are executed on different nodes by positional keys to retain duplicate keys in the requested order and retain the server response.

Previously duplicate keys were treated as set of keys and the response didn't match the requested keys.

Original Pull Request: #303
2018-01-23 12:57:16 +01:00
Christoph Strobl
765a6d1cb0 DATAREDIS-744 - Polishing
Move binary lookup methods to ByteUtils, update license headers and restore altered tests by creating additional ones.

Original Pull Request: #298
2018-01-11 14:53:13 +01:00
Mark Paluch
c6ad238cea DATAREDIS-744 - Support Redis hashes with colon in their id.
We now support Redis hashes via Repository support that contain colon in their id. We're using colons to split a composite id string into keyspace and id parts. Previously, we partially rejected processing of id's that don't exactly match the number of parts delimited by colon. This caused leftovers in secondary indexes.

Original Pull Request: #298
2018-01-11 14:52:36 +01:00
Christoph Strobl
cbd9dad96f DATAREDIS-603 - Polishing.
Fix erroneous test setup.

Original Pull Request: #275
2017-09-30 10:42:47 +02:00
Mark Paluch
06c37880f7 DATAREDIS-603 - Fall back to RedisSystemException for non translateable exceptions during cluster execution.
We now use a fallback exception translation strategy in JedisClusterConnection to map all non-mapped exceptions to RedisSystemException. This change prevents null pointer exceptions caused by potentially throwing null.

Original Pull Request: #275
2017-09-30 10:42:10 +02:00
Mark Paluch
9ac21cdafa DATAREDIS-687 - Polishing.
Parse Spring version for semantic version comparision. Remove redundant cast. Add issue tag to test, Visibility, formatting, imports.

Original pull request: #273.
2017-09-11 08:32:02 +02:00
Christoph Strobl
6e855f779e DATAREDIS-687 - Adapt Redis Cache tests to Spring 5.
Original pull request: #273.
2017-09-11 08:31:39 +02:00
Mark Paluch
fc07828b2f DATAREDIS-684 - Release Jedis cluster node connections with close().
We now release Jedis cluster node connections with Jedis.close() to the pool instead of Pool.returnResource(…). The close() method itself checks whether the connection was broken and if so, the connection gets destroyed. Destroying broken connections prevents the pool from supplying broken connections on borrow when testOnBorrow is disabled.

The only case where we return broken resources ourselves to the Pool is when we discover a broken connection ourselves: If we run into a NullPointerException or RedisConnectionFailureException, then we consider a connection is broken.

Original Pull Request: #271
2017-09-07 14:11:42 +02:00
Christoph Strobl
8b06c54246 DATAREDIS-679 - Polishing.
Use IllegalState- instead of IllegalArgumentException and utilize ExpectedException rule in tests.

Original Pull Request: #270
2017-09-07 11:06:01 +02:00
Mark Paluch
c855750535 DATAREDIS-679 - Reconfigure Jedis cluster connection pools for discovered cluster nodes.
We now request a cluster node connection directly from the driver's connection handler and initiate reconfiguration if a cluster node is known through the topology but has no connection pool yet. This can happen if a cluster node is added to the cluster after the connection was initialized.

The connection handler cannot be obtained directly although the field where it's held is protected which increases the amount of necessary test code and reflection access to the connection handler.

Jedis discovers nodes during startup, on demand (full scan) or when requested (e.g. by a cluster redirection).

Original Pull Request: #270
2017-09-07 11:05:51 +02:00
Mark Paluch
b07fe8d582 DATAREDIS-674 - Polishing.
Rename JedisConverters.zAddArgsConvertor(…) to toTupleMap(…) and reorder method to group with other tuple conversion methods. Add author tags.

Create tests for zadd with tuple using Redis Cluster. Enable pipelining and transactions for zadd using Jedis. Adopt tests.

Original pull request: #263.
2017-08-25 14:40:10 +02:00
Mark Paluch
cdb2624f62 DATAREDIS-676 - Polishing.
Set disposal state in LettuceClusterConnection only once. Close resources after tests. Typos, formatting.

Original pull request: #266.
2017-08-21 11:03:06 +02:00
Christoph Strobl
4e903113c7 DATAREDIS-676 - Pass on configured command timeout to LettuceClusterConnection.
We now not only configure the underlying lettuce connection with the command timeout set via the connection factory, but also make sure to pass the option on to the LettuceClusterConnection.

Original pull request: #266.
2017-08-21 11:03:03 +02:00
Mark Paluch
6f406debb0 DATAREDIS-657 - RedisRepositoryConfigurationExtensionUnitTests now need to provide a BeanDefinitionRegistry. 2017-06-26 17:07:41 +02:00
Mark Paluch
81c7c8f058 DATAREDIS-647 - Include last key of SDIFF for set difference retrieval.
We now consider the last key in SDIFF command execution on Redis Cluster to correctly compute the set difference.

Original Pull Request: #250
2017-06-12 14:56:00 +02:00
Mark Paluch
ac562c440f DATAREDIS-637 - Shut down connection-exclusive ClusterCommandExecutor.
We now shut down ClusterCommandExecutor via LettuceClusterConnection and JedisClusterConnection if the ClusterCommandExecutor was created through the connection instance. In such case ClusterCommandExecutor is managed through Lettuce/JedisClusterConnection and disposed on connection close.

Previously ClusterCommandExecutor created through a ClusterConnection was not disposed.

Original pull request: #247.
2017-05-03 14:54:59 +02:00
Mark Paluch
a382fb4a42 DATAREDIS-633 - Adapt to renamed KeyValueQuery.getCriteria() method.
Original Pull Request: #246
2017-04-24 10:39:09 +02:00
Mark Paluch
5ca2ce627f DATAREDIS-618 - Polishing.
Remove superfluous line breaks and trailing whitespaces. Create dedicated tests for RedisServer.

Original pull request: #241.
2017-03-31 11:10:26 +02:00
Mark Paluch
9b2e347c0c DATAREDIS-593 - Use Enum.name() to represent enum values.
We now serialize Enum values using their name (Enum.name()) instead of using their string representation (Enum.toString()). toString can be customized in Enums to no longer report their name but a different value. A customized value cannot be used to reinstantiate the Enum value, only its name.

This change affects serialization and will only affect new/updated values. Stored values with a customized toString representation still can't be deserialized until they were updated in Redis.

Original Pull Request: #235
2017-01-20 11:11:59 +01:00
Mark Paluch
1d089b44dc DATAREDIS-592 - Simplify test code in RedisCacheUnitTests.
Remove superfluous `times(1)` declaration in mock verification.

Original Pull Request: #234
2017-01-20 10:06:37 +01:00
Mark Paluch
cbbfad481c DATAREDIS-592 - Consider expiry timeout in synchronized RedisCache mode.
We now consider the element expiry when retrieving cache elements with a value loader. Previously, all cache elements that were cached using `@Cacheable(sync=true)` or used `RedisCache.get(Object, Callable)` directly were considered eternal without setting a TTL.

Original Pull Request: #234
2017-01-20 10:05:27 +01:00
Christoph Strobl
f75cf494f6 DATAREDIS-564 - Polishing.
Remove white spaces, update license header.
Add ticket reference to existing testcase.

Original Pull Request: #228
2017-01-13 09:30:35 +01:00
Mark Paluch
d00ab8c8f1 DATAREDIS-589 - Polishing.
Run expiry tests only when executing long-running tests. Guard RedisConnectionFactory against multiple initializations. Synchronize key expiry. Remove unused code. Extend years in license header.

Original pull request: #232.
2017-01-12 15:01:40 +01:00
Christoph Strobl
0f7607e515 DATAREDIS-589 - Move secondary index cleanup to MappingExpirationListener.
We now no longer rely on ApplicationEvents captured in the RedisKeyValueAdapter for performing cleanup operations for expired keys, but do this along with the phantom key removal. This removes a flaw when initializing a non repository related KeyspaceEventListener publishing events that actually are unrelated to the Adapter.

Additionally upgraded test infrastructure to utilize Redis 3.2.6 with disabled protected-mode and enabled keyspace-events.

Original pull request: #232.
2017-01-12 14:52:31 +01:00
Mark Paluch
154f74c408 DATAREDIS-563 - Migrate ticket references in test code to Spring Framework style. 2017-01-12 14:52:13 +01:00
Mark Paluch
116be39a7e DATAREDIS-552 - Polishing.
Apply client name to Sentinel and unpooled connections if set. Add ticket references to JavaDoc. Add tests. Fix existing JavaDoc letter casing and punctuation. Rearrange isClusterAware/isRedisSentinelAware methods.

Original pull request: #219.
2016-12-01 09:01:26 +01:00
Fu Jian
9117352ac0 DATAREDIS-552 - Support client name configuration for JedisConnectionFactory.
Motivation:
JedisConnectionFactory should support setting clientName for Jedis connections
so to improve troubleshooting.

Result:
Easier to troubleshooting with connection name.

Original pull request: #219.
2016-12-01 09:01:26 +01:00
Mark Paluch
aa3c40780a DATAREDIS-528 - Polishing.
Extend date ranges in license headers. Add author tags. Update documentation.

Original pull request: #222.
2016-10-12 16:34:13 +02:00
Christoph Strobl
4be4ed0b28 DATAREDIS-528 - Upgrade to Lettuce 4.2.2.
We now support Lettuce 4.2.2.Final. Using Lettuce requires Java 8.

Original pull request: #222.
2016-10-12 15:45:38 +02:00
Mark Paluch
f26441d48d DATAREDIS-553 - Support caching null values via RedisCache using callable.
Store `NullValue` placeholders when null value caching is allowed. Remove cache values when null value caching is disabled and the value loader returns a `null` value.

Original pull request: #221.
2016-10-12 15:07:09 +02:00
Christoph Strobl
4c54bf972a DATAREDIS-553 - Support caching null values via RedisCache.
We now support caching `null` values in `RedisCache` by storing a dedicated `NullValue` reference as a placeholder. To enable this feature please set up `RedisCacheManager` accordingly and make sure the used `RedisSerializer` is capable of dealing the `NullValue` type.
Both the `JdkSerializationRedisSerializer` and the `GenericJackson2JsonRedisSerializer` support this out of the box.

Original pull request: #221.
2016-10-12 15:06:59 +02:00