Commit Graph

23 Commits

Author SHA1 Message Date
Oliver Gierke
f11bc83e46 DATAREDIS-484 - After release cleanups. 2016-04-06 16:37:03 +02:00
Oliver Gierke
6e5df14794 DATAREDIS-484 - Prepare next development iteration. 2016-04-06 16:37:00 +02:00
Oliver Gierke
59b6b93abc DATAREDIS-484 - Release version 1.7 GA (Hopper). 2016-04-06 16:35:59 +02:00
Oliver Gierke
96358c430d DATAREDIS-484 - Prepare 1.7 GA (Hopper). 2016-04-06 16:34:46 +02:00
Oliver Gierke
93bad424d1 DATAREDIS-475 - After release cleanups. 2016-03-18 11:16:08 +01:00
Oliver Gierke
41b6e8a171 DATAREDIS-475 - Prepare next development iteration. 2016-03-18 11:15:51 +01:00
Oliver Gierke
6e2d2683d1 DATAREDIS-475 - Release version 1.7 RC1 (Hopper). 2016-03-18 11:15:00 +01:00
Oliver Gierke
5d5ff81cd2 DATAREDIS-475 - Prepare 1.7 RC1 (Hopper). 2016-03-18 11:06:58 +01:00
Mark Paluch
77de777da8 DATAREDIS-479 - Upgrade to jedis to 2.8.1.
Update jedis driver to 2.8.1. Use binary method for SSCAN and implement ZSCAN and HSCAN methods. Move ScanOptions to ScanParams conversion to JedisConverters.

Original Pull Request: #178
2016-03-15 14:32:37 +01:00
Mark Paluch
754639d137 DATAREDIS-478 - Upgrade to lettuce 3.4.2.Final. 2016-03-15 08:15:07 +01:00
Mark Paluch
92274a8450 DATAREDIS-425 - Add JSR-310 support, CDI extension and Update reference documentation.
We ship converters for JSR-310 types (LocalDate/Time, ZonedDateTime, Period, Duration and ZoneId) to map between UTF-8-encoded byte[] and JDK 8 date/time types.

We also export Redis Repositories in a CDI environment. Repositories can be injected using @Inject. The CDI extension requires at least RedisOperations to be provided. Other beans like RedisKeyValueAdapter and RedisKeyValueTemplate can be provided by the user. If no RedisKeyValueAdapter/RedisKeyValueTemplate beans are found, the CDI extension creates own managed instances.

Original Pull Request: #156
2016-03-14 10:39:50 +01:00
Christoph Strobl
bd7728e6ad DATAREDIS-425 - Add Support for basic CRUD and finder Operations backed by Hashes and Sets.
We now enable storing domain object as a flat Redis 'HASH' and maintain additional 'SET' structures to enable finder operations on simple properties.

  @RedisHash("persons");
  class Person {

    @id String id;
    @Indexed String firstname;
    String lastname;

    Map<String, String> attributes;

    City city;

    @Reference Person mother;
  }

The above is stored in the HASH with key 'persons:1' as

  _class = org.example.Person
  id = 1
  firstname = rand
  lastname = al’thor
  attributes.[eye-color] = grey
  attributes.[hair-color] = red
  city.name = emond's field
  city.region = two rivers
  mother = persons:2

Complex types are flattened out to their full property path for each of the values provided. If the properties actual value type does not match the declared one the '_class' type hint is added to the entry.

  city._class = CityInAndor.class
  city.name = emond's field
  city.region = two rivers
  city.country = andor

Map and Collection like structures are stored with their key/index values as part of the property path. If the map/collection value type does not match the actutal objects one the '_class' type hint is added to the entry.

  list.[0]._class = DomainType.class
  list.[0].property1 = ...

  map.[key-1]._class = DomainType.class
  map.[key-1].property1 = ...

Properties marked with '@Reference' are stored as semantic references by just storing the key to the referenced object 'HASH' instead of embedding its values.

   mother = persons:2

Please note that referenced objects are not transitively updated/saved and that lazy loading of references will be part of future development.

A 'save' operation therefore executes the following:

  # flatten domain type and add as hash
  HMSET persons:1 id 1 firstname rand …

  # add the newly inserted entry to the list of all entries of that type
  SADD persons 1

  # index the firstname for finder lookup
  SADD persons.firstname:rand 1

Simple finder operation like 'findByFirstname' use 'SINTER' to find matching

  SINTER persons.firstname:rand
  HGETALL persons:1

Besides resolving an index via the '@Index' annotation we also allow to add custom configuration via the 'indexConfiguration' attribute of '@EnableRedisRepositories'.

  @Configuration
  @EnableRedisRepositories(indexConfiguration = CustomIndexConfiguration.class)
  class Config { }

  static class CustomIndexConfiguration extends IndexConfiguration {

    @Override
    protected Iterable<RedisIndexDefinition> initialConfiguration() {
      return Arrays.asList(
        new SimpleIndexDefinition("persons", "lastname"),
      );
    }
  }

The '@TimeToLive' annotation allows to define a property or method providing an expiration time when storing the key in redis.

@RedisHash
class Person {

  @Id String id;
  @TimeToLive Long ttl;
}

Original Pull Request: #156
2016-03-14 10:37:53 +01:00
Oliver Gierke
68da4a4ee5 DATAREDIS-447 - After release cleanups. 2016-02-12 15:43:57 +01:00
Oliver Gierke
2f07334363 DATAREDIS-447 - Prepare next development iteration. 2016-02-12 15:43:39 +01:00
Oliver Gierke
b564d692d7 DATAREDIS-447 - Release version 1.7 M1 (Hopper). 2016-02-12 15:42:47 +01:00
Oliver Gierke
a02f266fec DATAREDIS-447 - Prepare 1.7 M1 (Hopper). 2016-02-12 15:36:20 +01:00
Mark Paluch
93fa71fd2c DATAREDIS-458 - Upgrade to lettuce 3.4.1.Final. 2016-02-11 14:55:10 +01:00
Mark Paluch
be40b0853a DATAREDIS-452 - Improve thread synchronization in RedisCacheTest.testCacheGetSynchronized.
Original Pull Request: #165
2016-02-10 14:57:51 +01:00
Christoph Strobl
c5047f40c6 DATAREDIS-315 - Add initial support for redis cluster (jedis/lettuce).
Cluster support is based on the very same building blocks as non clustered communication. RedisClusterConnection and extension to RedisConnection handles the communication with the Redis Cluster and translates errors into the Spring DAO exception hierarchy.

Redirects for to a specific keys to the corresponding slot serving node are handled by the driver libraries, higher level functions like collecting information accross nodes, or sending commands to all nodes in the cluster that are covered by RedisClusterConnection utilizing a ClusterCommandExecutor distributing commands accross the cluster and collecting results.

RedisTemplate provides access to cluster specific operations via the ClusterOperations interface that can be obtained via RedisTemplate.opsForCluster(). This allows to execute commands explicitly on a single node within the cluster while retaining de-/serialization features configured for the template.

Original pull request: #158.
2016-02-09 14:53:33 +01:00
Christoph Strobl
4893dc1533 DATAREDIS-315 - Bump driver lib versions (jedis/lettuce).
Original pull request: #158.
2016-02-09 14:53:28 +01:00
Christoph Strobl
bc962f1c08 DATAREDIS-419 - Remove Gradle build files. Activate Maven build.
Remove Gradle related build files and update version in Maven pom.xml to reflect current development iteration.

Original Pull Request: #164
2016-02-04 19:36:09 +01:00
Christoph Strobl
1f97623a7c DATAREDIS-443 - Add Support for Spring 4.3 synchronized mode to RedisCache.
As of Spring Framework 4.3.RC1, the `Cache` interface has a new `<T> T get(Object key, Callable<T> valueLoader);` method (see SPR-9254).

If no entry for the given key is found, the `Callable` is invoked to compute/load the value that is then put into redis and returned. Additionally concurrent calls get synchronized so that the `Callable` is only called once.

Using Spring Framework 4.3 failures result in `o.s.c.Cache$ValueRetrievalException` prior versions use `RedisSystemException`.

Original pull request: #162.
2016-02-04 09:13:42 +01:00
Christoph Strobl
b6e90752e7 DATAREDIS-419 - Move project build to Maven.
- Introduce Maven pom.xml.
- Moved Asciidoctor files to src/main/asciidoc.
- Moved notice.txt etc. to src/main/resources.
- Add logback.xml
- Update Makefile to use maven and pick build profiles.
- Update template.mf to pick up versions in pom.xml
- Add build matrix for spring versions to .travis.yml
- Use container based travis infrastructure.
- Update readme.
2016-01-29 20:09:21 +01:00