Commit Graph

1490 Commits

Author SHA1 Message Date
Mark Paluch
cdb3e2437d DATAREDIS-681 - Polishing.
Remove final keywords from variables in ClusterCommandExecutor. Reduce constructor visibility of driver-specific commands classes. Fix Javadoc.

Original Pull Request: #267
2017-09-08 14:09:43 +02:00
Mark Paluch
0dfeb365c9 DATAREDIS-681 - Fix spelling in MultiNodeResult and ResultByReferenceKeyPositionComparator.
Fix type and method names.

Original Pull Request: #267
2017-09-08 14:08:58 +02:00
Christoph Strobl
575296be9d DATAREDIS-614 - Polishing.
Remove whitespaces and update tests to use non deprecated API.

Original Pull Request: #274
2017-09-08 10:25:46 +02:00
Mark Paluch
3ea6083c93 DATAREDIS-614 - Rename GeoOperations methods to better names.
We removed the geo prefix from the imperative and reactive GeoOperations interfaces and our methods to match a more expressive scheme:

geoAdd(…) -> add(…)
geoDist(…) -> distance(…)
geoHash(…) -> hash(…)
geoPos(…) -> position(…)
geoRadius(…) -> radius(…)
geoRadiusByMember(…) -> radius(…)
geoRemove(…) -> remove(…)

Methods on the imperative API remain as deprecated default methods to retain compatibility and not enforce changes in the client code.

Original Pull Request: #274
2017-09-08 10:25:15 +02:00
Mark Paluch
b1aef2717e 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:19 +02:00
Christoph Strobl
f5ffa33f7e DATAREDIS-667 - Polishing.
Remove builder interfaces and aim for classes instead.
Also use delegation for builders avoiding constructors with too many arguments.
Alter ConnectionProvider#getConnection(Class) to return a typed connection as this is is the expected return type given the input parameters used.
Remove LettuceConnectionProvider.getConnection() method as it makes no longer sense for the non-lambda enabled interface. Remove unnecessary casts.
Add connection factory to cleanup-tracker on test class instantiation instead within the parameter supplier method to prevent shutdown by other cleanup calls that may happen in between. Reuse client resources.

Original Pull Request: #262
2017-09-07 13:31:50 +02:00
Mark Paluch
17309dd070 DATAREDIS-667 - Deprecate LettucePool and DefaultLettucePool.
Original Pull Request: #262
2017-09-07 13:22:37 +02:00
Mark Paluch
d731dfcf81 DATAREDIS-667 - Align Lettuce connection-pooling with LettuceClientConfiguration.
We now support Lettuce connection pooling by configuring a specialized client configuration via LettucePoolingClientConfiguration.builder(). Pooling settings can be configured through the builder and used with LettuceConnectionFactory.

Connection pooling is supported with Standalone and Sentinel-managed connections.

LettucePoolingClientConfiguration.builder()
   .poolConfig(poolConfig)
   .and() // allows configuration of further settings.

Original Pull Request: #262
2017-09-07 13:20:34 +02:00
Mark Paluch
5ac7f8eb19 DATAREDIS-667 - Introduce LettuceConnectionProvider.
We now create and release Lettuce connections using LettuceConnectionProvider. Connection providers encapsulate the underlying client and expose only creation and release methods. A connection provider can provide connections for Standalone or Cluster connections or wrap a LettucePool.

Previously we used RedisClient and RedisClusterClient directly which required context propagation (pooling/non-pooling) conditional code to obtain the appropriate connection type.

Original Pull Request: #262
2017-09-07 13:19:55 +02:00
Christoph Strobl
5c37948219 DATAREDIS-679 - Polishing.
Use IllegalState- instead of IllegalArgumentException and utilize ExpectedException rule in tests.

Original Pull Request: #270
2017-09-07 10:05:20 +02:00
Mark Paluch
bbd4482f26 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 10:00:24 +02:00
Christoph Strobl
00add116e9 DATAREDIS-685 - Update test configuration to use Redis 4.0.1.
Alos alter ClusterConnectionTests to be more robust.
2017-08-31 13:01:47 +02:00
Christoph Strobl
38d9f340c3 DATAREDIS-683 - Polishing.
Rename *Operators -> *Executor and use plain RedisElementReader/Writer instead of SerilaizationPairs. Therefore we’ve introduced new static factory methods creating the required Reader/Writer from a given RedisSerializer.
Additionally some minor Javadoc updates, tests and removal of redundant null checks.

Original Pull Request: #268
2017-08-31 09:55:03 +02:00
Mark Paluch
a3b50ba765 DATAREDIS-683 - Provide reactive Lua script execution commands.
We now support Redis Lua script execution using reactive infrastructure through the reactive connection and template API.

Flux<V> execute = reactiveTemplate.execute(new DefaultRedisScript<>("return redis.call('get', KEYS[1])", String.class), Collections.singletonList(key));

Release the reactive connection consistently after Publisher termination. Extract shared code between DefaultScriptExecutor and DefaultScriptOperators in ScriptUtils.

Original Pull Request: #268
2017-08-31 09:54:21 +02:00
Mark Paluch
95500d4d72 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:39:46 +02:00
Clement Ong
42ba71a2b2 DATAREDIS-674 - Support zAdd with a Set of Tuples using Jedis Cluster connections.
Original pull request: #263.
2017-08-25 14:39:30 +02:00
Mark Paluch
6513e77f7d DATAREDIS-680 - Polishing.
Add author tag. Adopt javadoc fix in other affected operations and connection interfaces.

Original pull request: #265.
2017-08-25 12:17:47 +02:00
Rosty Kerei
646e068c8d DATAREDIS-680 - Fix Javadoc references on ZSet score methods.
Point to the correct method in the Redis documentation.

Original pull request: #265.
2017-08-25 12:16:48 +02:00
Mark Paluch
9fb2e3181b DATAREDIS-676 - Polishing.
Simplify command timeout access. Set disposal state in LettuceClusterConnection only once. Close resources after tests.

Original pull request: #266.
2017-08-21 10:25:20 +02:00
Christoph Strobl
7c20dd2f83 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 10:16:32 +02:00
Mark Paluch
65d320b3c8 DATAREDIS-668 - Polishing.
Align JavaDoc for consistent wording. Remove superfluous final keyword from variables in DefaultSetOperations.

Replace anonymous inner classes with lambdas/method references, where possible. Remove superfluous final keywords used for local variable. Add override JavaDocs and missing Override annoations. Use diamond syntax where possible. Formatting, license headers. Reduce visibility of Default Operations implementations to package-scope.

Original pull request: #259.
2017-07-28 09:36:48 +02:00
Christoph Strobl
6ef4a6f8eb DATAREDIS-668 - Polishing.
Update comments, fix/add missing Javadoc and simplify implementation.

Original pull request: #259.
2017-07-28 09:30:07 +02:00
Christoph Strobl
c87e0af0ef DATAREDIS-668 - Add SPOP with COUNT command.
We now support SPOP command with COUNT option throughout the imperative, cluster and reactive API.

Original pull request: #259.
2017-07-28 09:29:23 +02:00
Oliver Gierke
3616d69bf6 DATAREDIS-669 - Updated changelog. 2017-07-27 00:49:01 +02:00
Oliver Gierke
e3c124536e DATAREDIS-670 - After release cleanups. 2017-07-25 16:10:39 +02:00
Oliver Gierke
1325b89deb DATAREDIS-670 - Prepare next development iteration. 2017-07-25 16:10:35 +02:00
Oliver Gierke
89f55fd814 DATAREDIS-670 - Release version 2.0 RC2 (Kay). 2017-07-25 15:34:24 +02:00
Oliver Gierke
6916a89716 DATAREDIS-670 - Prepare 2.0 RC2 (Kay). 2017-07-25 15:33:33 +02:00
Oliver Gierke
01ae2af9fd DATAREDIS-670 - Updated changelog. 2017-07-25 15:33:29 +02:00
Oliver Gierke
4d700695fe DATAREDIS-655 - After release cleanups. 2017-07-25 10:00:09 +02:00
Oliver Gierke
038200b2be DATAREDIS-655 - Prepare next development iteration. 2017-07-25 10:00:06 +02:00
Oliver Gierke
12ac8e3d12 DATAREDIS-655 - Release version 2.0 RC1 (Kay). 2017-07-25 09:48:49 +02:00
Oliver Gierke
f280077134 DATAREDIS-655 - Prepare 2.0 RC1 (Kay). 2017-07-25 09:48:02 +02:00
Oliver Gierke
6432e36c88 DATAREDIS-655 - Updated changelog. 2017-07-25 09:47:58 +02:00
Oliver Gierke
6291363283 DATAREDIS-653 - Updated changelog. 2017-07-24 22:20:45 +02:00
Mark Paluch
5719947ee7 DATAREDIS-664 - Polishing.
Remove Serializable ID constraints from factory beans. Replace casts with type.cast(…). Convert anonymous inner classes to lambdas. Remove unused code and casts. Simplify test entities by removing Serializable and using lombok. Formatting, Javadoc.

Original pull request: #256.
2017-07-21 15:33:31 +02:00
Christoph Strobl
bb19a9add2 DATAREDIS-664 - Adapt to ID type changes in KV module.
Related issue: DATAKV-187
Related pull request: spring-projects/spring-data-keyvalue#25
Original pull request: #256.
2017-07-21 15:33:28 +02:00
Mark Paluch
b0d139af2e DATAREDIS-665 - Upgrade to Lettuce 5.0 RC1.
Adapt to changes in Lettuce API.
2017-07-20 15:55:02 +02:00
Mark Paluch
54ba6e3494 DATAREDIS-663 - Inherit Project Reactor version from dependency management.
Adapt to BOM import in Spring Data Build pom.
2017-07-20 11:06:02 +02:00
Christoph Strobl
4fc58ad8cf DATAREDIS-661 - Polishing.
Update JavaDoc and remove usage of MapUtils brought in via optional transitive dependency.

Original Pull Request: #255
2017-07-18 14:01:35 +02:00
Mark Paluch
8f88b78eeb DATAREDIS-661 - Refactor RedisServerCommands.getConfig(…) output to Properties.
Use Properties instead of List of Strings arranged as sequence of key-value pairs to improve value lookup. Properties allows direct value lookup whereas the List previously required List scanning for an index and another index access to retrieve the actual value.

Original Pull Request: #255
2017-07-18 14:00:37 +02:00
Christoph Strobl
50551fd182 DATAREDIS-508 - Polishing.
Update JavaDoc, remove trailing whitespace and skip cluster tests if cluster not available.
2017-07-18 13:12:44 +02:00
Mark Paluch
12b030b1f7 DATAREDIS-508 - Support lettuce Pub/Sub when using Redis Cluster.
We now use Lettuce's Redis Cluster Pub/Sub connection to create Pub/Sub connections in a cluster.
2017-07-18 13:12:25 +02:00
Mark Paluch
36f680ff5b DATAREDIS-481 - Polishing.
Reduce visibility of DefaultRedisCacheWriter as trivial implementation. Replace ConnectionCallback with Java 8 functions. Increase visibility of the RedisCache constructor to allow subclassing. Move factory methods to create DefaultRedisCacheWriter to RedisCacheWriter interface.

Refactor RedisCacheManagerConfigurator to stateful RedisCacheManagerBuilder. Remove RedisCache.setTransactionAware override in RedisCacheManagerConfigurator removing behavior not compliant with AbstractTransactionSupportingCacheManager. Terminate interrupted cache wait loop with exception. Javadoc, formatting, reorder methods.

Allow ConversionService configuration via RedisCacheConfiguration. Accept cache keys that are either convertible to String or that override toString to obtain the String representation of the cache key.

Original pull request: #252.
2017-07-13 10:08:46 +02:00
Christoph Strobl
a9c2b1cdda DATAREDIS-481 - Revise RedisCache.
RedisCache now operates directly with RedisConnectionFactory allowing each Cache to use its own SerializationPair for cache key and value conversion.

A RedisCacheManager with default settings is created with RedisCacheManager.create(connectionFactory). Use RedisCacheManager.builder(…) to obtain a builder to customize cache settings.

RedisCacheManager cm = RedisCacheManager.builder(connectionFactory)
  .cacheDefaults(defaultCacheConfig())
  .initialCacheConfigurations(singletonMap("predefined", defaultCacheConfig().disableCachingNullValues()))
  .transactionAware()
  .build();

The behavior of a single RedisCache is defined via its RedisCacheConfiguration. Starting from defaultCacheConfig() the configuration can be altered as needed.

RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
  .entryTtl(Duration.ofSeconds(1))
  .disableCachingNullValues();

RedisCacheManager defaults to a lock-free RedisCacheWriter for reading & writing binary values. Lock-free caching improves throughput. The lack of entry locking can lead to overlapping, non atomic commands, for putIfAbsent and clean methods as those require multiple commands sent to Redis. The locking counterpart prevents command overlap by setting an explicit lock key and checking against presence of this key, which leads to additional requests and potential command wait times.

Original pull request: #252.
2017-07-13 10:08:36 +02:00
Christoph Strobl
eb3ad1e351 DATAREDIS-659 - Polishing.
Update JavaDoc and assert nullability contract.
Use slowlog-max-len in tests instead of maxclients avoiding potential ulimit errors.

Original Pull Request: #253
2017-07-07 14:22:51 +02:00
Mark Paluch
4c88fe1794 DATAREDIS-659 - Polishing.
Replace anonymous inner classes with lambdas. Reformat.

Original Pull Request: #253
2017-07-07 14:22:37 +02:00
Mark Paluch
1f2610ba91 DATAREDIS-659 - Provide ReactiveServerCommands for basic server interaction.
Original Pull Request: #253
2017-07-07 14:22:17 +02:00
Mark Paluch
772d412ba8 DATAREDIS-660 - Adapt to API changes in mapping subsystem. 2017-07-04 14:34:47 +02:00
Christoph Strobl
a06162de0e DATAREDIS-625 - Remove outdated copy of TestSubscriber.
Remove copy of TestSubscriber and replace usage with StepVerifier.
2017-06-30 08:47:57 +02:00