From 45f19a6c1d81ebd0fec5fe86763232f74b20720f Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 10 Mar 2017 08:47:19 +0200 Subject: [PATCH] #166 - Rename Redis cluster-sentinel to sentinel. Rename the Redis cluster-sentinel project to sentinel and leave a hint in the cluster-sentinel directory that points to the Redis Cluster and Redis Sentinel examples mentioning clarifying the cluster-sentinel naming. --- README.md | 2 +- redis/cluster-sentinel/README.md | 29 ++----------------- redis/pom.xml | 8 ++--- redis/sentinel/README.md | 28 ++++++++++++++++++ redis/{cluster-sentinel => sentinel}/pom.xml | 4 +-- .../sentinel/RedisSentinelApplication.java | 2 +- .../src/main/resources/application.properties | 0 7 files changed, 39 insertions(+), 34 deletions(-) create mode 100644 redis/sentinel/README.md rename redis/{cluster-sentinel => sentinel}/pom.xml (84%) rename redis/{cluster-sentinel => sentinel}/src/main/java/example/springdata/redis/sentinel/RedisSentinelApplication.java (98%) rename redis/{cluster-sentinel => sentinel}/src/main/resources/application.properties (100%) diff --git a/README.md b/README.md index a9226a21..7c38f524 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ We have separate folders for the samples of individual modules: * `example` - Example for basic Spring Data Redis setup. * `cluster` - Example for Redis Cluster support. -* `cluster-sentinel` - Example for Redis Sentinel support. +* `sentinel` - Example for Redis Sentinel support. * `repository` - Example demonstrating Spring Data repository abstraction on top of Redis. ## Spring Data Elasticsearch diff --git a/redis/cluster-sentinel/README.md b/redis/cluster-sentinel/README.md index b3758789..1c6e89f5 100644 --- a/redis/cluster-sentinel/README.md +++ b/redis/cluster-sentinel/README.md @@ -1,28 +1,5 @@ -# Spring Data Redis - Sentinel Examples +# Spring Data Redis Example -This project contains samples of Sentinel specific features of Spring Data Redis. - -## Support for Sentinel - -```java -@Configuration -public class RedisSentinelApplicationConfig { - - static final RedisSentinelConfiguration SENTINEL_CONFIG = new RedisSentinelConfiguration().master("mymaster") // - .sentinel("localhost", 26379) // - .sentinel("localhost", 26380) // - .sentinel("localhost", 26381); - - @Bean - public RedisConnectionFactory connectionFactory() { - return new JedisConnectionFactory(sentinelConfig()); - } - - @Bean - public RedisSentinelConfiguration sentinelConfig() { - return SENTINEL_CONFIG; - } - -} -``` +The this example was named a bit misleading as `cluster-sentinel` is a mix of Redis Cluster and Redis Sentinel. +Find dedicated examples here: [Redis Cluster](../cluster) and [Redis Sentinel](../sentinel). diff --git a/redis/pom.xml b/redis/pom.xml index 8ed4e576..caabdfa1 100644 --- a/redis/pom.xml +++ b/redis/pom.xml @@ -16,12 +16,12 @@ Sample projects for Spring Data Redis - util - cluster-sentinel - example cluster - repositories + example reactive + repositories + sentinel + util diff --git a/redis/sentinel/README.md b/redis/sentinel/README.md new file mode 100644 index 00000000..b3758789 --- /dev/null +++ b/redis/sentinel/README.md @@ -0,0 +1,28 @@ +# Spring Data Redis - Sentinel Examples + +This project contains samples of Sentinel specific features of Spring Data Redis. + +## Support for Sentinel + +```java +@Configuration +public class RedisSentinelApplicationConfig { + + static final RedisSentinelConfiguration SENTINEL_CONFIG = new RedisSentinelConfiguration().master("mymaster") // + .sentinel("localhost", 26379) // + .sentinel("localhost", 26380) // + .sentinel("localhost", 26381); + + @Bean + public RedisConnectionFactory connectionFactory() { + return new JedisConnectionFactory(sentinelConfig()); + } + + @Bean + public RedisSentinelConfiguration sentinelConfig() { + return SENTINEL_CONFIG; + } + +} +``` + diff --git a/redis/cluster-sentinel/pom.xml b/redis/sentinel/pom.xml similarity index 84% rename from redis/cluster-sentinel/pom.xml rename to redis/sentinel/pom.xml index 1a3dabd1..0107d333 100644 --- a/redis/cluster-sentinel/pom.xml +++ b/redis/sentinel/pom.xml @@ -2,8 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-data-redis-cluster-sentinel-example - Spring Data Redis - Cluster/Sentinel Example + spring-data-redis-sentinel-example + Spring Data Redis - Sentinel Example org.springframework.data.examples diff --git a/redis/cluster-sentinel/src/main/java/example/springdata/redis/sentinel/RedisSentinelApplication.java b/redis/sentinel/src/main/java/example/springdata/redis/sentinel/RedisSentinelApplication.java similarity index 98% rename from redis/cluster-sentinel/src/main/java/example/springdata/redis/sentinel/RedisSentinelApplication.java rename to redis/sentinel/src/main/java/example/springdata/redis/sentinel/RedisSentinelApplication.java index a38192ef..f063086c 100644 --- a/redis/cluster-sentinel/src/main/java/example/springdata/redis/sentinel/RedisSentinelApplication.java +++ b/redis/sentinel/src/main/java/example/springdata/redis/sentinel/RedisSentinelApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/redis/cluster-sentinel/src/main/resources/application.properties b/redis/sentinel/src/main/resources/application.properties similarity index 100% rename from redis/cluster-sentinel/src/main/resources/application.properties rename to redis/sentinel/src/main/resources/application.properties