Skip to content

Commit f1d528f

Browse files
mp911dechristophstrobl
authored andcommitted
Remove usage of oppressive language.
The API exposes now the renamed command terminology (replica) only and no longer the deprecated one. Closes: #2195 See: #2274 Original Pull Request: #2276
1 parent 69205c5 commit f1d528f

File tree

47 files changed

+210
-239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+210
-239
lines changed

src/main/asciidoc/appendix/appendix-command-reference.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
|RANDOMKEY |X
116116
|RENAME |X
117117
|RENAMENX |X
118+
|REPLICAOF |X
118119
|RESTORE |X
119120
|ROLE |-
120121
|RPOP |X

src/main/java/org/springframework/data/redis/connection/ClusterTopology.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public Set<RedisClusterNode> getNodes() {
5555
}
5656

5757
/**
58-
* Get all nodes (master and slave) in cluster where {@code link-state} is {@literal connected} and {@code flags} does
59-
* not contain {@literal fail} or {@literal fail?}.
58+
* Get all nodes (master and replica) in cluster where {@code link-state} is {@literal connected} and {@code flags}
59+
* does not contain {@literal fail} or {@literal fail?}.
6060
*
6161
* @return never {@literal null}.
6262
*/
@@ -105,7 +105,7 @@ public Set<RedisClusterNode> getMasterNodes() {
105105
}
106106

107107
/**
108-
* Get the {@link RedisClusterNode}s (master and slave) serving s specific slot.
108+
* Get the {@link RedisClusterNode}s (master and replica) serving s specific slot.
109109
*
110110
* @param slot
111111
* @return never {@literal null}.

src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,13 +2444,13 @@ public List<RedisClientInfo> getClientList() {
24442444
}
24452445

24462446
@Override
2447-
public void slaveOf(String host, int port) {
2448-
this.delegate.slaveOf(host, port);
2447+
public void replicaOf(String host, int port) {
2448+
this.delegate.replicaOf(host, port);
24492449
}
24502450

24512451
@Override
2452-
public void slaveOfNoOne() {
2453-
this.delegate.slaveOfNoOne();
2452+
public void replicaOfNoOne() {
2453+
this.delegate.replicaOfNoOne();
24542454
}
24552455

24562456
@Override

src/main/java/org/springframework/data/redis/connection/DefaultedRedisConnection.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,15 +1755,15 @@ default List<RedisClientInfo> getClientList() {
17551755
/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
17561756
@Override
17571757
@Deprecated
1758-
default void slaveOf(String host, int port) {
1759-
serverCommands().slaveOf(host, port);
1758+
default void replicaOf(String host, int port) {
1759+
serverCommands().replicaOf(host, port);
17601760
}
17611761

17621762
/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */
17631763
@Override
17641764
@Deprecated
1765-
default void slaveOfNoOne() {
1766-
serverCommands().slaveOfNoOne();
1765+
default void replicaOfNoOne() {
1766+
serverCommands().replicaOfNoOne();
17671767
}
17681768

17691769
/** @deprecated in favor of {@link RedisConnection#serverCommands()}. */

src/main/java/org/springframework/data/redis/connection/ReactiveClusterCommands.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,22 @@ public interface ReactiveClusterCommands {
4646
Flux<RedisClusterNode> clusterGetNodes();
4747

4848
/**
49-
* Retrieve information about connected slaves for given master node.
49+
* Retrieve information about connected replicas for given master node.
5050
*
5151
* @param master must not be {@literal null}.
5252
* @return a {@link Flux} emitting {@link RedisClusterNode cluster nodes}, an {@link Flux#empty() empty one} if none
5353
* found.
54-
* @see <a href="https://redis.io/commands/cluster-slaves">Redis Documentation: CLUSTER SLAVES</a>
54+
* @see <a href="https://redis.io/commands/cluster-replicas">Redis Documentation: CLUSTER REPLICAS</a>
5555
*/
56-
Flux<RedisClusterNode> clusterGetSlaves(RedisClusterNode master);
56+
Flux<RedisClusterNode> clusterGetReplicas(RedisClusterNode master);
5757

5858
/**
59-
* Retrieve information about masters and their connected slaves.
59+
* Retrieve information about masters and their connected replicas.
6060
*
6161
* @return never {@literal null}.
62-
* @see <a href="https://redis.io/commands/cluster-slaves">Redis Documentation: CLUSTER SLAVES</a>
62+
* @see <a href="https://redis.io/commands/cluster-replicas">Redis Documentation: CLUSTER REPLICAS</a>
6363
*/
64-
Mono<Map<RedisClusterNode, Collection<RedisClusterNode>>> clusterGetMasterSlaveMap();
64+
Mono<Map<RedisClusterNode, Collection<RedisClusterNode>>> clusterGetMasterReplicaMap();
6565

6666
/**
6767
* Find the slot for a given {@code key}.
@@ -184,7 +184,7 @@ public interface ReactiveClusterCommands {
184184
Flux<ByteBuffer> clusterGetKeysInSlot(int slot, int count);
185185

186186
/**
187-
* Assign a {@literal slave} to given {@literal master}.
187+
* Assign a {@literal replica} to given {@literal master}.
188188
*
189189
* @param master must not be {@literal null}.
190190
* @param replica must not be {@literal null}.

src/main/java/org/springframework/data/redis/connection/RedisClusterCommands.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,21 @@ public interface RedisClusterCommands {
4141
Iterable<RedisClusterNode> clusterGetNodes();
4242

4343
/**
44-
* Retrieve information about connected slaves for given master node.
44+
* Retrieve information about connected replicas for given master node.
4545
*
4646
* @param master must not be {@literal null}.
4747
* @return never {@literal null}.
48-
* @see <a href="https://redis.io/commands/cluster-slaves">Redis Documentation: CLUSTER SLAVES</a>
48+
* @see <a href="https://redis.io/commands/cluster-replicas">Redis Documentation: CLUSTER REPLICAS</a>
4949
*/
50-
Collection<RedisClusterNode> clusterGetSlaves(RedisClusterNode master);
50+
Collection<RedisClusterNode> clusterGetReplicas(RedisClusterNode master);
5151

5252
/**
53-
* Retrieve information about masters and their connected slaves.
53+
* Retrieve information about masters and their connected replicas.
5454
*
5555
* @return never {@literal null}.
56-
* @see <a href="https://redis.io/commands/cluster-slaves">Redis Documentation: CLUSTER SLAVES</a>
56+
* @see <a href="https://redis.io/commands/cluster-replicas">Redis Documentation: CLUSTER REPLICAS</a>
5757
*/
58-
Map<RedisClusterNode, Collection<RedisClusterNode>> clusterGetMasterSlaveMap();
58+
Map<RedisClusterNode, Collection<RedisClusterNode>> clusterGetMasterReplicaMap();
5959

6060
/**
6161
* Find the slot for a given {@code key}.
@@ -171,7 +171,7 @@ public interface RedisClusterCommands {
171171
List<byte[]> clusterGetKeysInSlot(int slot, Integer count);
172172

173173
/**
174-
* Assign a {@literal slave} to given {@literal master}.
174+
* Assign a {@literal replica} to given {@literal master}.
175175
*
176176
* @param master must not be {@literal null}.
177177
* @param replica must not be {@literal null}.

src/main/java/org/springframework/data/redis/connection/RedisClusterNode.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public enum LinkState {
242242
*/
243243
public static enum Flag {
244244

245-
MYSELF("myself"), MASTER("master"), SLAVE("slave"), FAIL("fail"), PFAIL("fail?"), HANDSHAKE("handshake"), NOADDR(
245+
MYSELF("myself"), MASTER("master"), REPLICA("slave"), FAIL("fail"), PFAIL("fail?"), HANDSHAKE("handshake"), NOADDR(
246246
"noaddr"), NOFLAGS("noflags");
247247

248248
private String raw;
@@ -297,11 +297,6 @@ public RedisClusterNodeBuilder promotedAs(NodeType nodeType) {
297297
return this;
298298
}
299299

300-
public RedisClusterNodeBuilder slaveOf(String masterId) {
301-
super.slaveOf(masterId);
302-
return this;
303-
}
304-
305300
@Override
306301
public RedisClusterNodeBuilder replicaOf(String masterId) {
307302
super.replicaOf(masterId);

src/main/java/org/springframework/data/redis/connection/RedisConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,7 @@ interface ClusterConfiguration extends WithPassword {
482482
}
483483

484484
/**
485-
* Configuration interface suitable for Redis master/slave environments with fixed hosts. <br/>
486-
* Redis is undergoing a nomenclature change where the term replica is used synonymously to slave.
485+
* Configuration interface suitable for Redis master/replica environments with fixed hosts.
487486
*
488487
* @author Christoph Strobl
489488
* @author Mark Paluch

src/main/java/org/springframework/data/redis/connection/RedisNode.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,12 @@ public boolean isMaster() {
142142
return ObjectUtils.nullSafeEquals(NodeType.MASTER, getType());
143143
}
144144

145-
/**
146-
* @return
147-
* @since 1.7
148-
*/
149-
public boolean isSlave() {
150-
return isReplica();
151-
}
152-
153145
/**
154146
* @return
155147
* @since 2.1
156148
*/
157149
public boolean isReplica() {
158-
return ObjectUtils.nullSafeEquals(NodeType.SLAVE, getType());
150+
return ObjectUtils.nullSafeEquals(NodeType.REPLICA, getType());
159151
}
160152

161153
/**
@@ -214,7 +206,7 @@ public boolean equals(Object obj) {
214206
* @since 1.7
215207
*/
216208
public enum NodeType {
217-
MASTER, SLAVE
209+
MASTER, REPLICA
218210
}
219211

220212
/**
@@ -279,17 +271,6 @@ public RedisNodeBuilder promotedAs(NodeType type) {
279271
return this;
280272
}
281273

282-
/**
283-
* Set the id of the master node.
284-
*
285-
* @param masterId
286-
* @return
287-
* @since 1.7
288-
*/
289-
public RedisNodeBuilder slaveOf(String masterId) {
290-
return replicaOf(masterId);
291-
}
292-
293274
/**
294275
* Set the id of the master node.
295276
*

src/main/java/org/springframework/data/redis/connection/RedisSentinelCommands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public interface RedisSentinelCommands {
4242
Collection<RedisServer> masters();
4343

4444
/**
45-
* Show list of slaves for given {@literal master}.
45+
* Show list of replicas for given {@literal master}.
4646
*
4747
* @param master must not be {@literal null}.
4848
* @return Collection of {@link RedisServer}s. Never {@literal null}.
4949
*/
50-
Collection<RedisServer> slaves(NamedNode master);
50+
Collection<RedisServer> replicas(NamedNode master);
5151

5252
/**
5353
* Removes given {@literal master}. The server will no longer be monitored and will no longer be returned by

0 commit comments

Comments
 (0)