Commit Graph

1621 Commits

Author SHA1 Message Date
Mark Paluch
39964bc70f DATAREDIS-789 - Polishing.
Remove trailing whitespaces.

Original pull request: #324.
2018-03-21 16:21:07 +01:00
Jiahe Cai (佳何 蔡)
372dc6fbaa DATAREDIS-789 - Fixed Lua syntax error in reference documentation.
Original pull request: #324.
2018-03-21 16:21:04 +01:00
Christoph Strobl
4a064c5ad0 DATAREDIS-762 - Polishing.
Introduce marker interface RedisConfiguration along with several others providing access to specific setup scenarios like cluster and sentinel.

Original Pull Request: #306
2018-03-20 12:30:59 +01:00
Mark Paluch
bb990b14ae DATAREDIS-762 - Add AWS ElastiCache configuration.
We now provide RedisElastiCacheConfiguration to configure connections to AWS ElastiCache for Redis services with optional read replicas.

RedisElastiCacheConfiguration elastiCache = new RedisElastiCacheConfiguration("redis-node-1.elasticache.aws.com")
                                                   .node("redis-node-2.elasticache.aws.com");

LettuceConnectionFactory factory = new LettuceConnectionFactory(elastiCache, configuration);

Original Pull Request: #306
2018-03-20 12:29:48 +01:00
Christoph Strobl
c156c82cf0 DATAREDIS-545 - Polishing.
Format source and use dedicated getClient() method to obtain the clusterClient.

Original Pull Request: #297
2018-03-16 13:32:18 +01:00
Mark Paluch
155f45c376 DATAREDIS-545 - Support connection-pooling for Redis Cluster with Lettuce.
We now support connection pooling for Cluster connections using Lettuce.

Original Pull Request: #297
2018-03-16 13:31:53 +01:00
Mark Paluch
a3d4e4f771 DATAREDIS-731 - Polishing.
Document undocumented parameter. Fix typo.

Original Pull Request: #297
2018-03-16 13:31:28 +01:00
Mark Paluch
b656b09db5 DATAREDIS-731 - Share native Lettuce Cluster connection across LettuceClusterConnection.
We now share Lettuce Cluster connections if configured on LettuceConnectionFactory (enabled by default) across multiple LettuceClusterConnections. Connection sharing prevents creation and disposal of cluster connections per template command execution which improves overall performance.

Original Pull Request: #297
2018-03-16 13:31:02 +01:00
Christoph Strobl
09bd48c245 DATAREDIS-635 - Polishing.
Update Javadoc and format code a bit.

Original Pull Request: #296
2018-03-16 10:09:58 +01:00
Mark Paluch
c18a311aa9 DATAREDIS-635 - Add keyspace scanning using Redis Cluster.
We now support SCAN commands with Redis Cluster. Cluster-wide scanning is supported with Lettuce only and SCAN on a selected node works with both clients.

// Lettuce only
Cursor<byte[]> scan = clusterConnection.scan(ScanOptions.NONE);

// Jedis and Lettuce
Cursor<byte[]> scan = clusterConnection.scan(new RedisClusterNode("127.0.0.1", 7379, SlotRange.empty()), ScanOptions.NONE);

Original Pull Request: #296
2018-03-16 10:09:21 +01:00
Mark Paluch
871465fa3b DATAREDIS-787 - Retain stack trace in tests.
We now disable JVM's stack trace omission on fast code paths to investigate exceptions thrown within tests.
2018-03-14 12:02:12 +01:00
Mark Paluch
79dd124abc DATAREDIS-784 - Polishing.
Rename incrementBy and decrementBy to increment respective decrement. Use INCR and DECR for increment() and decrement() instead of INCRBY 1/INCRYBY -1. Rearrange method order to align with method order in ReactiveValueOperations. Tweak Javadoc, add since tags.

Introduce increment() and decrement(…) (as of INCR/DECR) to ValueOperations and BoundValueOperations and use ValueOperations.increment()/decrement() from RedisAtomicInteger. ValueOperations used INCRBY and DECRBY to increment and now we use the native command if methods without delta are invoked.

Original pull request: #322.
2018-03-14 11:48:36 +01:00
Jiahe Cai (佳何 蔡)
8857f96b9f DATAREDIS-784 - Add support for reactive increment and decrement commands to ReactiveValueOperations.
We now support reactive execution of the following increment and decrement commands through ReactiveValueOperations:

- INCR
- INCRBY
- INCRBYFLOAT
- DECR
- DECRBY

Original pull request: #322.
2018-03-14 11:48:36 +01:00
Christoph Strobl
452feb9420 DATAREDIS-543 - Polishing.
Move BucketPropertyPath to Bucket.

Original Pull Request: #299
2018-03-14 10:40:00 +01:00
Mark Paluch
9969a559ea DATAREDIS-543 - Polishing.
Cleanup references to MongoDB.

Original Pull Request: #299
2018-03-14 10:40:00 +01:00
Mark Paluch
04153e07b0 DATAREDIS-543 - Allow customized type aliasing.
We now support customization of type aliasing for types using through Redis Repositories. Type aliasing can be customized by either annotating types with @TypeAlias or by providing a RedisTypeMapper to MappingRedisConverter.

Map<Class<?>, String> mapping = new HashMap<>();

mapping.put(Person.class, "person");

ConfigurableTypeInformationMapper mapper = new ConfigurableTypeInformationMapper(mapping);
RedisTypeMapper typeMapper = new DefaultRedisTypeMapper(DefaultRedisTypeMapper.DEFAULT_TYPE_KEY, Collections.singletonList(mapper))

alternatively:

@RedisHash
@TypeAlias("person")
class Person {
  // …
}

Original Pull Request: #299
2018-03-14 10:40:00 +01:00
Jiahe Cai (佳何 蔡)
f3128bf0c0 DATAREDIS-783 - Fix typo in LettuceReactiveRedisConnection.
Original pull request: #321.
2018-03-14 10:23:31 +01:00
Mark Paluch
50c24f69d1 DATAREDIS-782 - Polishing.
Add setIfPresent(…) with expiry to reactive API. Add since tags, minor tweaks to javadoc and tests.

Original pull request: #320.
2018-03-14 10:15:50 +01:00
Jiahe Cai (佳何 蔡)
a2ed8e1d9b DATAREDIS-782 - Add support for SET key value NX EX max-lock-time.
We now expose ValueOperations.setIfAbsent(…) to set values when absent along their expiry.

Original pull request: #320.
2018-03-14 10:15:46 +01:00
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