diff --git a/src/main/java/org/springframework/data/redis/connection/RedisConfiguration.java b/src/main/java/org/springframework/data/redis/connection/RedisConfiguration.java index 7d0b58fb8..bb5c191b4 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisConfiguration.java @@ -95,10 +95,10 @@ public interface RedisConfiguration { /** * @param configuration can be {@literal null}. - * @return {@code true} if given {@link RedisConfiguration} is instance of {@link StaticMasterSlaveConfiguration}. + * @return {@code true} if given {@link RedisConfiguration} is instance of {@link StaticMasterReplicaConfiguration}. */ - static boolean isStaticMasterSlaveConfiguration(@Nullable RedisConfiguration configuration) { - return configuration instanceof StaticMasterSlaveConfiguration; + static boolean isStaticMasterReplicaConfiguration(@Nullable RedisConfiguration configuration) { + return configuration instanceof StaticMasterReplicaConfiguration; } /** @@ -323,12 +323,14 @@ public interface RedisConfiguration { } /** - * Configuration interface suitable for Redis master/slave environments with fixed hosts. + * Configuration interface suitable for Redis master/slave environments with fixed hosts.
+ * Redis is undergoing a nomenclature change where the term replica is used synonymously to slave. * * @author Christoph Strobl + * @author Mark Paluch * @since 2.1 */ - interface StaticMasterSlaveConfiguration extends WithDatabaseIndex, WithPassword { + interface StaticMasterReplicaConfiguration extends WithDatabaseIndex, WithPassword { /** * @return unmodifiable {@link List} of {@link RedisStandaloneConfiguration nodes}. diff --git a/src/main/java/org/springframework/data/redis/connection/RedisStaticMasterSlaveConfiguration.java b/src/main/java/org/springframework/data/redis/connection/RedisStaticMasterReplicaConfiguration.java similarity index 80% rename from src/main/java/org/springframework/data/redis/connection/RedisStaticMasterSlaveConfiguration.java rename to src/main/java/org/springframework/data/redis/connection/RedisStaticMasterReplicaConfiguration.java index 4bf2e9ec4..9655b663f 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisStaticMasterSlaveConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisStaticMasterReplicaConfiguration.java @@ -19,19 +19,20 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.springframework.data.redis.connection.RedisConfiguration.StaticMasterSlaveConfiguration; +import org.springframework.data.redis.connection.RedisConfiguration.StaticMasterReplicaConfiguration; import org.springframework.util.Assert; /** * Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using the provided - * Master / Slave configuration to nodes know to not change address. Eg. when connecting to - * AWS ElastiCache with Read Replicas . + * Master / Replica configuration to nodes know to not change address. Eg. when connecting to + * AWS ElastiCache with Read Replicas.
+ * Note: Redis is undergoing a nomenclature change where the term replica is used synonymously to slave. * * @author Mark Paluch * @author Christoph Strobl * @since 2.1 */ -public class RedisStaticMasterSlaveConfiguration implements RedisConfiguration, StaticMasterSlaveConfiguration { +public class RedisStaticMasterReplicaConfiguration implements RedisConfiguration, StaticMasterReplicaConfiguration { private static final int DEFAULT_PORT = 6379; @@ -40,21 +41,21 @@ public class RedisStaticMasterSlaveConfiguration implements RedisConfiguration, private RedisPassword password = RedisPassword.none(); /** - * Create a new {@link StaticMasterSlaveConfiguration} given {@code hostName}. + * Create a new {@link StaticMasterReplicaConfiguration} given {@code hostName}. * * @param hostName must not be {@literal null} or empty. */ - public RedisStaticMasterSlaveConfiguration(String hostName) { + public RedisStaticMasterReplicaConfiguration(String hostName) { this(hostName, DEFAULT_PORT); } /** - * Create a new {@link StaticMasterSlaveConfiguration} given {@code hostName} and {@code port}. + * Create a new {@link StaticMasterReplicaConfiguration} given {@code hostName} and {@code port}. * * @param hostName must not be {@literal null} or empty. * @param port a valid TCP port (1-65535). */ - public RedisStaticMasterSlaveConfiguration(String hostName, int port) { + public RedisStaticMasterReplicaConfiguration(String hostName, int port) { addNode(hostName, port); } @@ -86,9 +87,9 @@ public class RedisStaticMasterSlaveConfiguration implements RedisConfiguration, * Add a {@link RedisStandaloneConfiguration node} to the list of nodes given {@code hostName}. * * @param hostName must not be {@literal null} or empty. - * @return {@code this} {@link StaticMasterSlaveConfiguration}. + * @return {@code this} {@link StaticMasterReplicaConfiguration}. */ - public StaticMasterSlaveConfiguration node(String hostName) { + public StaticMasterReplicaConfiguration node(String hostName) { return node(hostName, DEFAULT_PORT); } @@ -97,9 +98,9 @@ public class RedisStaticMasterSlaveConfiguration implements RedisConfiguration, * * @param hostName must not be {@literal null} or empty. * @param port a valid TCP port (1-65535). - * @return {@code this} {@link StaticMasterSlaveConfiguration}. + * @return {@code this} {@link StaticMasterReplicaConfiguration}. */ - public RedisStaticMasterSlaveConfiguration node(String hostName, int port) { + public RedisStaticMasterReplicaConfiguration node(String hostName, int port) { addNode(hostName, port); return this; @@ -151,7 +152,7 @@ public class RedisStaticMasterSlaveConfiguration implements RedisConfiguration, /* * (non-Javadoc) - * @see org.springframework.data.redis.connection.RedisConfiguration.StaticMasterSlaveConfiguration#getNodes() + * @see org.springframework.data.redis.connection.RedisConfiguration.StaticMasterReplicaConfiguration#getNodes() */ @Override public List getNodes() { diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClientConfiguration.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClientConfiguration.java index f83e45492..f8a515e5e 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClientConfiguration.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClientConfiguration.java @@ -39,7 +39,7 @@ import org.springframework.util.Assert; *
  • Optional {@link ClientResources}
  • *
  • Optional {@link ClientOptions}
  • *
  • Optional client name
  • - *
  • Optional {@link ReadFrom}. Enables Master/Slave operations if configured.
  • + *
  • Optional {@link ReadFrom}. Enables Master/Replica operations if configured.
  • *
  • Client {@link Duration timeout}
  • *
  • Shutdown {@link Duration timeout}
  • * @@ -85,6 +85,8 @@ public interface LettuceClientConfiguration { Optional getClientName(); /** + * Note: Redis is undergoing a nomenclature change where the term replica is used synonymously to slave. + * * @return the optional {@link io.lettuce.core.ReadFrom} setting. * @since 2.1 */ @@ -200,7 +202,8 @@ public interface LettuceClientConfiguration { } /** - * Configure {@link ReadFrom}. Enables Master/Slave operations if configured. + * Configure {@link ReadFrom}. Enables Master/Replica operations if configured.
    + * Note: Redis is undergoing a nomenclature change where the term replica is used synonymously to slave. * * @param readFrom must not be {@literal null}. * @return {@literal this} builder. diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactory.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactory.java index e48a6f59c..b42934339 100644 --- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactory.java +++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnectionFactory.java @@ -73,7 +73,7 @@ import org.springframework.util.ClassUtils; * {@link LettuceConnectionFactory client configuration}. Lettuce supports the following environmental configurations: *