Commit Graph

1602 Commits

Author SHA1 Message Date
Mark Paluch
567fa43e60 DATAREDIS-785 - Export composable repositories via CDI.
We now export composable repositories through our CDI extension. Repositories can now be customized either by a single custom implementation (as it was before) and by providing fragment interfaces along their fragment implementation.

This change aligns CDI support with the existing RepositoryFactory support we provide within a Spring application context.
2018-03-12 16:41:04 +01:00
Mark Paluch
2bc940a558 DATAREDIS-779 - Polishing.
Reformat code. Add ticket references to tests.

Original pull request: #317.
2018-03-07 10:36:44 +01:00
Jiahe Cai (佳何 蔡)
fe80804873 DATAREDIS-779 - Emit false if a conditional ReactiveStringCommands.set(…) does not set a value.
We now emit false when SET XX/SET NX complete without setting the value because the condition was evaluated to not set the value. Previously, we did not emit a value as Redis responds null (nil). This behavior becomes visible through ReactiveValueOperations.set[ifPresent|ifAbsent](…) methods.

This is a breaking change in the sense that changes the character of ReactiveValueOperations.set[ifPresent|ifAbsent](…) from an optionally emitted element to always emit. Reactive sequences that currently resume operation with .switchIfEmpty(…) will no longer utilize the fallback publisher.

Original pull request: #317.
2018-03-07 10:35:38 +01:00
Mark Paluch
1f6790b100 DATAREDIS-780 - Update guidelines for serialization usage. 2018-03-06 14:10:17 +01:00
Christoph Strobl
468345115a DATAREDIS-746 - Polishing.
Move delegates to default methods.

Original Pull Request: #314
2018-03-05 14:31:37 +01:00
Mark Paluch
56a01625d5 DATAREDIS-746 - Add Zset intersect operation aggregation support.
We now support aggregation and weight options for ZINTERSTORE. We also encapsulate weights used for ZUNIONSTORE and ZINTERSTORE within a Weights value object.

zSetOps.intersectAndStore(set1, Arrays.asList(set2, set3), out, Aggregate.MAX,
				Weights.of(1, 2, 1));

Related ticket: DATAREDIS-515.

Original Pull Request: #314
2018-03-05 14:30:55 +01:00
Mark Paluch
7d6524bace DATAREDIS-746 - Polishing.
Add since tags. Add imports for nested RedisZSetCommands types. Simplify tests.

Original pull request: #300 superseded by #314.
2018-03-05 14:30:03 +01:00
wangoo
3bc1f3368b DATAREDIS-746 - Add Zset union operation aggregation support.
Original pull request: #300 superseded by #314
2018-03-05 14:28:58 +01:00
Mark Paluch
76a8103582 DATAREDIS-774 - Updated changelog. 2018-02-28 11:17:39 +01:00
Christoph Strobl
afac748611 DATAREDIS-775 - Polishing.
Remove whitespaces, update Javadoc and use most specific return type to avoid unnecessary casts.

Original Pull Request: #316
2018-02-27 13:16:42 +01:00
Mark Paluch
0b60d632cc DATAREDIS-775 - Expose Lettuce RedisClient through RedisClientProvider.
We now expose the underlying Redis Client instance via RedisClientProvider.getRedisClient() to components that require direct client interaction. The client is exposed through ClusterConnectionProvider and now also through LettucePoolingConnectionProvider.

Exposing the client via LettucePoolingConnectionProvider allows Redis Cluster usage with connection pooling.

Original Pull Request: #316
2018-02-27 13:16:10 +01:00
Mark Paluch
997afadc23 DATAREDIS-760 - Updated changelog. 2018-02-19 20:30:08 +01:00
Mark Paluch
51d91c16e0 DATAREDIS-773 - Upgrade to Lettuce 5.0.2.RELEASE. 2018-02-18 18:35:43 +01:00
Mark Paluch
e499dcfdaa DATAREDIS-764 - Fix code quotation and mention default serializers.
Original Pull Request: #305
2018-02-16 13:33:01 +01:00
Christoph Strobl
afbd5b1e4d 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:12:32 +01:00
Mark Paluch
208f9e12c4 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 13:12:32 +01:00
Mark Paluch
d6d5b9e610 DATAREDIS-715 - Polishing.
Rename prefixKeysWith(CacheKeyPrefix) to computePrefixWith(…) and drop computePrefixWith(Function) in favor of CacheKeyPrefix. Refactor nullable keyPrefix to non-nullable. Extract default prefixing scheme to CacheKeyPrefix.simple().

Original pull request: #313.
2018-02-16 11:51:05 +01:00
Christoph Strobl
3c0e3050ed DATAREDIS-715 - Allow computation of cache key prefix.
We now allow, in addition to a static key prefix, the computation of prefixes based on the cache name. This change introduces an alternative to the in 2.x removed org.springframework.data.redis.cache.RedisCacheKey, and gives users more control over cache key generation.

Original pull request: #313.
2018-02-16 11:50:51 +01:00
Mark Paluch
67095bca8c DATAREDIS-767 - Polishing.
Align field naming and semantics with builder. Extend JavaDoc.

Original pull request: #311.
2018-02-15 11:37:50 +01:00
Christoph Strobl
8142836bbf DATAREDIS-767 - Add flag to disable in flight Cache creation.
We now provide a flag to disable the in flight cache creation for unconfigured caches. This gives eg. a CompositeCacheManager the possibility to chime in.

Original pull request: #311.
2018-02-15 11:37:50 +01:00
Christoph Strobl
3f7f98e229 DATAREDIS-710 - After release cleanups. 2018-02-06 10:11:17 +01:00
Christoph Strobl
d799663491 DATAREDIS-710 - Prepare next development iteration. 2018-02-06 10:11:15 +01:00
Christoph Strobl
20b1f40a9a DATAREDIS-710 - Release version 2.1 M1 (Lovelace). 2018-02-06 09:47:10 +01:00
Christoph Strobl
19fc7b8f28 DATAREDIS-710 - Prepare 2.1 M1 (Lovelace). 2018-02-06 09:45:50 +01:00
Christoph Strobl
981b72a61f DATAREDIS-710 - Updated changelog. 2018-02-06 09:45:48 +01:00
Mark Paluch
b1f6bc7698 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:00:39 +01:00
Mark Paluch
2fe048bfff DATAREDIS-737 - Updated changelog. 2018-01-24 13:41:24 +01:00
Mark Paluch
8cb0dd339a DATAREDIS-759 - Fix line endings to LF. 2018-01-24 13:04:40 +01:00
Mark Paluch
c559b8dc9b DATAREDIS-736 - Updated changelog. 2018-01-24 12:22:15 +01:00
Christoph Strobl
48d8b67b25 DATAREDIS-756 - Polishing.
Visibility modifications.

Original Pull Request: #303
2018-01-23 14:28:36 +01:00
Mark Paluch
c20d9ca742 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 09:47:25 +01:00
Mark Paluch
6d4acdef4c DATAREDIS-605 - Increase visibility of Lettuce SSL configuration builder methods.
Builder methods of LettuceSslClientConfigurationBuilder and LettucePoolingClientConfigurationBuilder are public now.
2018-01-17 10:31:25 +01:00
Christoph Strobl
e148e1439d DATAREDIS-714 - Polishing.
Add unit tests.

Original Pull Request: #291
2018-01-12 10:01:13 +01:00
Mark Paluch
aa4d784df0 DATAREDIS-714 - 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
2018-01-12 10:00:12 +01:00
Christoph Strobl
d8ec35f48b 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-12 07:50:53 +01:00
Mark Paluch
5de73903c1 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-12 07:50:21 +01:00
Christoph Strobl
323cb32861 DATAREDIS-605 - Polishing
Some minor code and documentation changes. More interestingly obtain the RedisConverter instead of the KeyValueAdapter for IndexResolver resolution in  QueryByExampleRedisExecutor and stick to findOne contract by throwing IncorrectResultSizeDataAccessException for queries returning non unique results.

Original Pull Request: #301
2018-01-10 15:01:26 +01:00
Mark Paluch
a3f876f926 DATAREDIS-605 - Query by Example for Redis Repositories.
We now support query by example via Redis repositories. We allow case-sensitive, exact matching of singular simple and nested properties, using any/all match modes, value transformation of the criteria value for indexed properties.

We do not support findAll with sorting, case-insensitive properties or string matchers other than exact.

interface PersonRepository extends QueryByExampleExecutor<Person> {
}

class PersonService {

  @Autowired PersonRepository personRepository;

  List<Person> findPeople(Person probe) {
    return personRepository.findAll(Example.of(probe));
  }
}

Original Pull Request: #301
2018-01-10 15:00:23 +01:00
Mark Paluch
2be6a3b3f7 DATAREDIS-751 - Update copyright years to 2018. 2018-01-08 16:39:32 +01:00
Mark Paluch
d6cc8fa109 DATAREDIS-738 - Align changelog layout with other modules.
Remove links to Jira Github branches. Fix letter casing.
2017-12-02 15:44:28 -08:00
Mark Paluch
b141b24cb8 DATAREDIS-723 - Updated changelog. 2017-11-27 16:43:44 +01:00
Mark Paluch
48b6d73a21 DATAREDIS-717 - Updated changelog. 2017-11-27 15:58:47 +01:00
Christoph Strobl
fe2bacda92 DATAREDIS-580 - Polishing.
Fix tests not closing connections properly. Remove usage of Optional in constructors, avoid recreating DirectFieldAccessor on every getConnection call and update documentation.

Original Pull Request: #287
2017-11-21 14:37:39 +01:00
Mark Paluch
b414fdf6f1 DATAREDIS-580 - Support Master/Slave connections with ReadFrom settings using Lettuce.
We now allow configuration of ReadFrom settings using the Lettuce driver to enable slave reads. If ReadFrom is configured, we opt-in to Master/Slave connections instead of plain connections. Master/Slave connections route commands to the configured type of node depending on whether the command is a read or write command.

LettuceClientConfiguration configuration = LettuceClientConfiguration.builder().readFrom(ReadFrom.SLAVE).build();

ReadFrom is available for:

* Static Master/Slave Redis without Redis Sentinel
* Sentinel-Managed Master/Slave Redis
* Redis Cluster

ReadFrom is not configured for Pub/Sub connections or connections to the actual Sentinel servers.

Original Pull Request: #287
2017-11-21 14:36:46 +01:00
Mark Paluch
9775734f6f DATAREDIS-693 - Polishing.
Add Template methods for unlink(…). Align unlink with del/mDel methods on reactive API using concatMap to retain order and provide batching/streaming. Reword Javadoc. Extend tests.

Replace blocking calls with StepVerifier in LettuceReactiveKeyCommandsTests.

Original pull request: #294.
2017-11-20 13:37:39 +01:00
Christoph Strobl
c11b8d89ea DATAREDIS-693 - Add support for UNLINK.
We now support UNLINK for both Jedis & Lettuce throughout the single node and cluster connection. Reactive support is only available for Lettuce.

Original pull request: #294.
2017-11-20 13:23:36 +01:00
Christoph Strobl
3ec25eebb8 DATAREDIS-682 - Polishing.
Enforce nullability constraints and update documentation.

Original Pull Request: #286
2017-11-17 17:26:07 +01:00
Mark Paluch
d08ab93421 DATAREDIS-682 - Connect to Redis using unix domain sockets.
We now support Redis connections using OS-native transports through unix domain sockets when using the Lettuce driver. Domain sockets do not require a roundtrip through the networking layer but directly use native epoll or kqueue interfaces.

LettuceConnectionFactory factory = new LettuceConnectionFactory(new RedisSocketConfiguration("/var/run/redis.sock"));

Unix domain socket support requires netty's native epoll/kqueue dependencies matching the runtime environment:

<dependency>
	<groupId>io.netty</groupId>
	<artifactId>netty-transport-native-epoll</artifactId>
	<classifier>linux-x86_64</classifier>
	<version>${netty}</version>
</dependency>

<dependency>
	<groupId>io.netty</groupId>
	<artifactId>netty-transport-native-kqueue</artifactId>
	<classifier>osx-x86_64</classifier>
	<version>${netty}</version>
</dependency>

Original Pull Request: #286
2017-11-17 17:13:41 +01:00
Mark Paluch
5c16a6044c DATAREDIS-735 - Upgrade to Lettuce 5.0.1. 2017-11-16 19:13:17 +01:00
Mark Paluch
58e17d57b4 DATAREDIS-706 - Polishing.
Add author tag. Replace JedisCluster…Commands constructors with RequiredArgsConstructor annotation.

Original pull request: #278.
2017-11-16 15:39:48 +01:00