@@ -42,7 +42,7 @@ def mget_nonatomic(self, keys, *args):
42
42
43
43
Returns a list of values ordered identically to ``keys``
44
44
45
- For more information check https://redis.io/commands/mget
45
+ For more information see https://redis.io/commands/mget
46
46
"""
47
47
48
48
from redis .client import EMPTY_RESPONSE
@@ -80,7 +80,7 @@ def mset_nonatomic(self, mapping):
80
80
for the keys of every slot. This operation will not be atomic
81
81
if keys belong to more than one slot.
82
82
83
- For more information check https://redis.io/commands/mset
83
+ For more information see https://redis.io/commands/mset
84
84
"""
85
85
86
86
# Partition the keys by slot
@@ -120,7 +120,7 @@ def exists(self, *keys):
120
120
whole cluster. The keys are first split up into slots
121
121
and then an EXISTS command is sent for every slot
122
122
123
- For more information check https://redis.io/commands/exists
123
+ For more information see https://redis.io/commands/exists
124
124
"""
125
125
return self ._split_command_across_slots ("EXISTS" , * keys )
126
126
@@ -133,7 +133,7 @@ def delete(self, *keys):
133
133
Non-existant keys are ignored.
134
134
Returns the number of keys that were deleted.
135
135
136
- For more information check https://redis.io/commands/del
136
+ For more information see https://redis.io/commands/del
137
137
"""
138
138
return self ._split_command_across_slots ("DEL" , * keys )
139
139
@@ -148,7 +148,7 @@ def touch(self, *keys):
148
148
Non-existant keys are ignored.
149
149
Returns the number of keys that were touched.
150
150
151
- For more information check https://redis.io/commands/touch
151
+ For more information see https://redis.io/commands/touch
152
152
"""
153
153
return self ._split_command_across_slots ("TOUCH" , * keys )
154
154
@@ -162,7 +162,7 @@ def unlink(self, *keys):
162
162
Non-existant keys are ignored.
163
163
Returns the number of keys that were unlinked.
164
164
165
- For more information check https://redis.io/commands/unlink
165
+ For more information see https://redis.io/commands/unlink
166
166
"""
167
167
return self ._split_command_across_slots ("UNLINK" , * keys )
168
168
@@ -179,23 +179,23 @@ def slaveof(self, *args, **kwargs):
179
179
"""
180
180
Make the server a replica of another instance, or promote it as master.
181
181
182
- For more information check https://redis.io/commands/slaveof
182
+ For more information see https://redis.io/commands/slaveof
183
183
"""
184
184
raise RedisClusterException ("SLAVEOF is not supported in cluster mode" )
185
185
186
186
def replicaof (self , * args , ** kwargs ):
187
187
"""
188
188
Make the server a replica of another instance, or promote it as master.
189
189
190
- For more information check https://redis.io/commands/replicaof
190
+ For more information see https://redis.io/commands/replicaof
191
191
"""
192
192
raise RedisClusterException ("REPLICAOF is not supported in cluster" " mode" )
193
193
194
194
def swapdb (self , * args , ** kwargs ):
195
195
"""
196
196
Swaps two Redis databases.
197
197
198
- For more information check https://redis.io/commands/swapdb
198
+ For more information see https://redis.io/commands/swapdb
199
199
"""
200
200
raise RedisClusterException ("SWAPDB is not supported in cluster" " mode" )
201
201
@@ -237,7 +237,7 @@ def stralgo(
237
237
``withmatchlen`` Returns the matches with the len of the match.
238
238
Can be provided only when ``idx`` set to True.
239
239
240
- For more information check https://redis.io/commands/stralgo
240
+ For more information see https://redis.io/commands/stralgo
241
241
"""
242
242
target_nodes = kwargs .pop ("target_nodes" , None )
243
243
if specific_argument == "strings" and target_nodes is None :
@@ -328,7 +328,7 @@ def cluster_addslots(self, target_node, *slots):
328
328
:target_node: 'ClusterNode'
329
329
The node to execute the command on
330
330
331
- For more information check https://redis.io/commands/cluster-addslots
331
+ For more information see https://redis.io/commands/cluster-addslots
332
332
"""
333
333
return self .execute_command (
334
334
"CLUSTER ADDSLOTS" , * slots , target_nodes = target_node
@@ -344,7 +344,7 @@ def cluster_addslotsrange(self, target_node, *slots):
344
344
:target_node: 'ClusterNode'
345
345
The node to execute the command on
346
346
347
- For more information check https://redis.io/commands/cluster-addslotsrange
347
+ For more information see https://redis.io/commands/cluster-addslotsrange
348
348
"""
349
349
return self .execute_command (
350
350
"CLUSTER ADDSLOTSRANGE" , * slots , target_nodes = target_node
@@ -355,7 +355,7 @@ def cluster_countkeysinslot(self, slot_id):
355
355
Return the number of local keys in the specified hash slot
356
356
Send to node based on specified slot_id
357
357
358
- For more information check https://redis.io/commands/cluster-countkeysinslot
358
+ For more information see https://redis.io/commands/cluster-countkeysinslot
359
359
"""
360
360
return self .execute_command ("CLUSTER COUNTKEYSINSLOT" , slot_id )
361
361
@@ -364,7 +364,7 @@ def cluster_count_failure_report(self, node_id):
364
364
Return the number of failure reports active for a given node
365
365
Sends to a random node
366
366
367
- For more information check https://redis.io/commands/cluster-count-failure-reports
367
+ For more information see https://redis.io/commands/cluster-count-failure-reports
368
368
"""
369
369
return self .execute_command ("CLUSTER COUNT-FAILURE-REPORTS" , node_id )
370
370
@@ -375,7 +375,7 @@ def cluster_delslots(self, *slots):
375
375
376
376
Returns a list of the results for each processed slot.
377
377
378
- For more information check https://redis.io/commands/cluster-delslots
378
+ For more information see https://redis.io/commands/cluster-delslots
379
379
"""
380
380
return [self .execute_command ("CLUSTER DELSLOTS" , slot ) for slot in slots ]
381
381
@@ -386,7 +386,7 @@ def cluster_delslotsrange(self, *slots):
386
386
from the node, while CLUSTER DELSLOTSRANGE takes a list of slot ranges to remove
387
387
from the node.
388
388
389
- For more information check https://redis.io/commands/cluster-delslotsrange
389
+ For more information see https://redis.io/commands/cluster-delslotsrange
390
390
"""
391
391
return self .execute_command ("CLUSTER DELSLOTSRANGE" , * slots )
392
392
@@ -398,7 +398,7 @@ def cluster_failover(self, target_node, option=None):
398
398
:target_node: 'ClusterNode'
399
399
The node to execute the command on
400
400
401
- For more information check https://redis.io/commands/cluster-failover
401
+ For more information see https://redis.io/commands/cluster-failover
402
402
"""
403
403
if option :
404
404
if option .upper () not in ["FORCE" , "TAKEOVER" ]:
@@ -418,7 +418,7 @@ def cluster_info(self, target_nodes=None):
418
418
The command will be sent to a random node in the cluster if no target
419
419
node is specified.
420
420
421
- For more information check https://redis.io/commands/cluster-info
421
+ For more information see https://redis.io/commands/cluster-info
422
422
"""
423
423
return self .execute_command ("CLUSTER INFO" , target_nodes = target_nodes )
424
424
@@ -427,7 +427,7 @@ def cluster_keyslot(self, key):
427
427
Returns the hash slot of the specified key
428
428
Sends to random node in the cluster
429
429
430
- For more information check https://redis.io/commands/cluster-keyslot
430
+ For more information see https://redis.io/commands/cluster-keyslot
431
431
"""
432
432
return self .execute_command ("CLUSTER KEYSLOT" , key )
433
433
@@ -436,7 +436,7 @@ def cluster_meet(self, host, port, target_nodes=None):
436
436
Force a node cluster to handshake with another node.
437
437
Sends to specified node.
438
438
439
- For more information check https://redis.io/commands/cluster-meet
439
+ For more information see https://redis.io/commands/cluster-meet
440
440
"""
441
441
return self .execute_command (
442
442
"CLUSTER MEET" , host , port , target_nodes = target_nodes
@@ -447,15 +447,15 @@ def cluster_nodes(self):
447
447
Get Cluster config for the node.
448
448
Sends to random node in the cluster
449
449
450
- For more information check https://redis.io/commands/cluster-nodes
450
+ For more information see https://redis.io/commands/cluster-nodes
451
451
"""
452
452
return self .execute_command ("CLUSTER NODES" )
453
453
454
454
def cluster_replicate (self , target_nodes , node_id ):
455
455
"""
456
456
Reconfigure a node as a slave of the specified master node
457
457
458
- For more information check https://redis.io/commands/cluster-replicate
458
+ For more information see https://redis.io/commands/cluster-replicate
459
459
"""
460
460
return self .execute_command (
461
461
"CLUSTER REPLICATE" , node_id , target_nodes = target_nodes
@@ -468,7 +468,7 @@ def cluster_reset(self, soft=True, target_nodes=None):
468
468
If 'soft' is True then it will send 'SOFT' argument
469
469
If 'soft' is False then it will send 'HARD' argument
470
470
471
- For more information check https://redis.io/commands/cluster-reset
471
+ For more information see https://redis.io/commands/cluster-reset
472
472
"""
473
473
return self .execute_command (
474
474
"CLUSTER RESET" , b"SOFT" if soft else b"HARD" , target_nodes = target_nodes
@@ -478,23 +478,23 @@ def cluster_save_config(self, target_nodes=None):
478
478
"""
479
479
Forces the node to save cluster state on disk
480
480
481
- For more information check https://redis.io/commands/cluster-saveconfig
481
+ For more information see https://redis.io/commands/cluster-saveconfig
482
482
"""
483
483
return self .execute_command ("CLUSTER SAVECONFIG" , target_nodes = target_nodes )
484
484
485
485
def cluster_get_keys_in_slot (self , slot , num_keys ):
486
486
"""
487
487
Returns the number of keys in the specified cluster slot
488
488
489
- For more information check https://redis.io/commands/cluster-getkeysinslot
489
+ For more information see https://redis.io/commands/cluster-getkeysinslot
490
490
"""
491
491
return self .execute_command ("CLUSTER GETKEYSINSLOT" , slot , num_keys )
492
492
493
493
def cluster_set_config_epoch (self , epoch , target_nodes = None ):
494
494
"""
495
495
Set the configuration epoch in a new node
496
496
497
- For more information check https://redis.io/commands/cluster-set-config-epoch
497
+ For more information see https://redis.io/commands/cluster-set-config-epoch
498
498
"""
499
499
return self .execute_command (
500
500
"CLUSTER SET-CONFIG-EPOCH" , epoch , target_nodes = target_nodes
@@ -507,7 +507,7 @@ def cluster_setslot(self, target_node, node_id, slot_id, state):
507
507
:target_node: 'ClusterNode'
508
508
The node to execute the command on
509
509
510
- For more information check https://redis.io/commands/cluster-setslot
510
+ For more information see https://redis.io/commands/cluster-setslot
511
511
"""
512
512
if state .upper () in ("IMPORTING" , "NODE" , "MIGRATING" ):
513
513
return self .execute_command (
@@ -523,7 +523,7 @@ def cluster_setslot_stable(self, slot_id):
523
523
Clears migrating / importing state from the slot.
524
524
It determines by it self what node the slot is in and sends it there.
525
525
526
- For more information check https://redis.io/commands/cluster-setslot
526
+ For more information see https://redis.io/commands/cluster-setslot
527
527
"""
528
528
return self .execute_command ("CLUSTER SETSLOT" , slot_id , "STABLE" )
529
529
@@ -532,7 +532,7 @@ def cluster_replicas(self, node_id, target_nodes=None):
532
532
Provides a list of replica nodes replicating from the specified primary
533
533
target node.
534
534
535
- For more information check https://redis.io/commands/cluster-replicas
535
+ For more information see https://redis.io/commands/cluster-replicas
536
536
"""
537
537
return self .execute_command (
538
538
"CLUSTER REPLICAS" , node_id , target_nodes = target_nodes
@@ -542,7 +542,7 @@ def cluster_slots(self, target_nodes=None):
542
542
"""
543
543
Get array of Cluster slot to node mappings
544
544
545
- For more information check https://redis.io/commands/cluster-slots
545
+ For more information see https://redis.io/commands/cluster-slots
546
546
"""
547
547
return self .execute_command ("CLUSTER SLOTS" , target_nodes = target_nodes )
548
548
@@ -554,7 +554,7 @@ def cluster_links(self, target_node):
554
554
555
555
This command outputs information of all such peer links as an array.
556
556
557
- For more information check https://redis.io/commands/cluster-links
557
+ For more information see https://redis.io/commands/cluster-links
558
558
"""
559
559
return self .execute_command ("CLUSTER LINKS" , target_nodes = target_node )
560
560
@@ -564,7 +564,7 @@ def readonly(self, target_nodes=None):
564
564
The command will be sent to the default cluster node if target_nodes is
565
565
not specified.
566
566
567
- For more information check https://redis.io/commands/readonly
567
+ For more information see https://redis.io/commands/readonly
568
568
"""
569
569
if target_nodes == "replicas" or target_nodes == "all" :
570
570
# read_from_replicas will only be enabled if the READONLY command
@@ -578,7 +578,7 @@ def readwrite(self, target_nodes=None):
578
578
The command will be sent to the default cluster node if target_nodes is
579
579
not specified.
580
580
581
- For more information check https://redis.io/commands/readwrite
581
+ For more information see https://redis.io/commands/readwrite
582
582
"""
583
583
# Reset read from replicas flag
584
584
self .read_from_replicas = False
0 commit comments