Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Commit f0627c9

Browse files
timgates42Grokzen
authored andcommitted
docs: fix a few simple typos
There are small typos in: - CONTRIBUTING.md - docs/development.rst - docs/index.rst - docs/logging.rst - docs/pubsub.rst - docs/upgrading.rst - rediscluster/client.py - rediscluster/connection.py - tests/test_cluster_node_manager.py - tests/test_commands.py - tests/test_encoding_cluster.py Fixes: - Should read `specified` rather than `specefied`. - Should read `implementation` rather than `impelmentation`. - Should read `upstream` rather than `uptream`. - Should read `iterate` rather than `itterate`. - Should read `recommended` rather than `reccommended`. - Should read `received` rather than `recieved`. - Should read `preferred` rather than `preffered`. - Should read `possibility` rather than `posiblity`. - Should read `interval` rather than `intervall`. - Should read `examples` rather than `exmaples`. - Should read `documentation` rather than `documentaion`. Closes #461
1 parent d94f2fe commit f0627c9

File tree

11 files changed

+27
-27
lines changed

11 files changed

+27
-27
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ All tests should be assumed to work against the test environment that is impleme
8888

8989
## Testing strategy and how to implement cluster specific tests
9090

91-
A new way of having the old upstream tests from redis-py combined with the cluster specific and unique tests that is needed to validate cluster functionality. This has been designed to improve the speed of which tests is updated from uptream as new redis-py releases is made and to make it easier to port them into the cluster variant.
91+
A new way of having the old upstream tests from redis-py combined with the cluster specific and unique tests that is needed to validate cluster functionality. This has been designed to improve the speed of which tests is updated from upstream as new redis-py releases is made and to make it easier to port them into the cluster variant.
9292

9393
How do you implement a test for this code?
9494

docs/development.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ To start the local development server run from the root folder of this git repo
1919
2020
sphinx-autobuild docs docs/_build/html
2121
22-
Open up `localhost:8000` in your web-browser to view the online documentaion
22+
Open up `localhost:8000` in your web-browser to view the online documentation

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ or from source code
3131
Basic usage example
3232
-------------------
3333

34-
Small sample script that shows how to get started with RedisCluster. It can also be found in the file `exmaples/basic.py`.
34+
Small sample script that shows how to get started with RedisCluster. It can also be found in the file `examples/basic.py`.
3535

3636
Additional code examples of more advance functionality can be found in the `examples/` folder in the source code git repo.
3737

docs/logging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ To setup logging for debugging inside the client during development you can add
1414
logger.setLevel(logging.DEBUG)
1515
logger.propagate = True
1616
17-
Note that this logging is not reccommended to be used inside production as it can cause a performance drain and a slowdown of your client.
17+
Note that this logging is not recommended to be used inside production as it can cause a performance drain and a slowdown of your client.

docs/pubsub.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ According to the current official redis documentation on `PUBLISH`::
77

88
Integer reply: the number of clients that received the message.
99

10-
It was initially assumed that if we had clients connected to different nodes in the cluster it would still report back the correct number of clients that recieved the message.
10+
It was initially assumed that if we had clients connected to different nodes in the cluster it would still report back the correct number of clients that received the message.
1111

1212
However after some testing of this command it was discovered that it would only report the number of clients that have subscribed on the same server the `PUBLISH` command was executed on.
1313

@@ -60,7 +60,7 @@ This new solution is probably future safe and it will probably be a similar solu
6060
Known limitations with pubsub
6161
-----------------------------
6262

63-
Pattern subscribe and publish do not work properly because if we hash a pattern like `fo*` we will get a keyslot for that string but there is a endless posiblity of channel names based on that pattern that we can't know in advance. This feature is not limited but the commands is not recommended to use right now.
63+
Pattern subscribe and publish do not work properly because if we hash a pattern like `fo*` we will get a keyslot for that string but there is a endless possibility of channel names based on that pattern that we can't know in advance. This feature is not limited but the commands is not recommended to use right now.
6464

6565
The implemented solution will only work if other clients use/adopt the same behaviour. If some other client behaves differently, there might be problems with `PUBLISH` and `SUBSCRIBE` commands behaving wrong.
6666

docs/upgrading.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Added new `ClusterCrossSlotError` exception class.
108108
Added optional `max_connections_per_node` parameter to `ClusterConnectionPool` which changes behavior of `max_connections` so that it applies per-node rather than across the whole cluster. The new feature is opt-in, and the existing default behavior is unchanged. Users are recommended to opt-in as the feature fixes two important problems. First is that some nodes could be starved for connections after max_connections is used up by connecting to other nodes. Second is that the asymmetric number of connections across nodes makes it challenging to configure file descriptor and redis max client settings.
109109

110110
Reinitialize on `MOVED` errors will not run on every error but instead on every
111-
25 error to avoid excessive cluster reinitialize when used in multiple threads and resharding at the same time. If you want to go back to the old behaviour with reinitialize on every error you should pass in `reinitialize_steps=1` to the client constructor. If you want to increase or decrease the intervall of this new behaviour you should set `reinitialize_steps` in the client constructor to a value that you want.
111+
25 error to avoid excessive cluster reinitialize when used in multiple threads and resharding at the same time. If you want to go back to the old behaviour with reinitialize on every error you should pass in `reinitialize_steps=1` to the client constructor. If you want to increase or decrease the interval of this new behaviour you should set `reinitialize_steps` in the client constructor to a value that you want.
112112

113113
Pipelines in general have received a lot of attention so if you are using pipelines in your code, ensure that you test the new code out a lot before using it to make sure it still works as you expect.
114114

rediscluster/client.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -774,23 +774,23 @@ def cluster_addslots(self, node_id, *slots):
774774
"""
775775
Assign new hash slots to receiving node
776776
777-
Sends to specefied node
777+
Sends to specified node
778778
"""
779779
return self.execute_command('CLUSTER ADDSLOTS', *slots, node_id=node_id)
780780

781781
def cluster_countkeysinslot(self, slot_id):
782782
"""
783783
Return the number of local keys in the specified hash slot
784784
785-
Send to node based on specefied slot_id
785+
Send to node based on specified slot_id
786786
"""
787787
return self.execute_command('CLUSTER COUNTKEYSINSLOT', slot_id)
788788

789789
def cluster_count_failure_report(self, node_id):
790790
"""
791791
Return the number of failure reports active for a given node
792792
793-
Sends to specefied node
793+
Sends to specified node
794794
"""
795795
return self.execute_command('CLUSTER COUNT-FAILURE-REPORTS', node_id=node_id)
796796

@@ -812,7 +812,7 @@ def cluster_failover(self, node_id, option=None):
812812
"""
813813
Forces a slave to perform a manual failover of its master
814814
815-
Sends to specefied node
815+
Sends to specified node
816816
"""
817817
if option:
818818
if option.upper() not in ['FORCE', 'TAKEOVER']:
@@ -842,7 +842,7 @@ def cluster_meet(self, node_id, host, port):
842842
"""
843843
Force a node cluster to handshake with another node.
844844
845-
Sends to specefied node
845+
Sends to specified node
846846
"""
847847
return self.execute_command('CLUSTER MEET', host, port, node_id=node_id)
848848

@@ -858,7 +858,7 @@ def cluster_replicate(self, target_node_id):
858858
"""
859859
Reconfigure a node as a slave of the specified master node
860860
861-
Sends to specefied node
861+
Sends to specified node
862862
"""
863863
return self.execute_command('CLUSTER REPLICATE', target_node_id)
864864

@@ -869,7 +869,7 @@ def cluster_reset(self, node_id, soft=True):
869869
If 'soft' is True then it will send 'SOFT' argument
870870
If 'soft' is False then it will send 'HARD' argument
871871
872-
Sends to specefied node
872+
Sends to specified node
873873
"""
874874
return self.execute_command('CLUSTER RESET', b'SOFT' if soft else b'HARD', node_id=node_id)
875875

@@ -901,15 +901,15 @@ def cluster_save_config(self):
901901

902902
def cluster_get_keys_in_slot(self, slot, num_keys):
903903
"""
904-
Returns the number of keys in the specefied cluster slot
904+
Returns the number of keys in the specified cluster slot
905905
"""
906906
return self.execute_command('CLUSTER GETKEYSINSLOT', slot, num_keys)
907907

908908
def cluster_set_config_epoch(self, node_id, epoch):
909909
"""
910910
Set the configuration epoch in a new node
911911
912-
Sends to specefied node
912+
Sends to specified node
913913
"""
914914
return self.execute_command('CLUSTER SET-CONFIG-EPOCH', epoch, node_id=node_id)
915915

@@ -918,7 +918,7 @@ def cluster_setslot(self, node_id, slot_id, state, bind_to_node_id=None):
918918
"""
919919
Bind an hash slot to a specific node
920920
921-
Sends to specefied node
921+
Sends to specified node
922922
"""
923923
if state.upper() in ('IMPORTING', 'MIGRATING', 'NODE') and node_id is not None:
924924
return self.execute_command('CLUSTER SETSLOT', slot_id, state, node_id)

rediscluster/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ def get_connection_by_key(self, key, command):
596596

597597
def get_master_connection_by_slot(self, slot):
598598
"""
599-
Returns a connection for the Master node for the specefied slot.
599+
Returns a connection for the Master node for the specified slot.
600600
601601
Do not return a random node if master node is not available for any reason.
602602
"""
@@ -606,7 +606,7 @@ def get_master_connection_by_slot(self, slot):
606606
def get_random_master_slave_connection_by_slot(self, slot):
607607
"""
608608
Returns a random connection from the set of (master + slaves) for the
609-
specefied slot. If connection is not reachable then return a random connection.
609+
specified slot. If connection is not reachable then return a random connection.
610610
"""
611611
self._checkpid()
612612

tests/test_cluster_node_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def patch_execute_command(*args, **kwargs):
158158

159159
def test_empty_startup_nodes():
160160
"""
161-
It should not be possible to create a node manager with no nodes specefied
161+
It should not be possible to create a node manager with no nodes specified
162162
"""
163163
with pytest.raises(RedisClusterException):
164164
NodeManager()
@@ -252,7 +252,7 @@ def execute_command(*args, **kwargs):
252252

253253
def test_all_nodes():
254254
"""
255-
Set a list of nodes and it should be possible to itterate over all
255+
Set a list of nodes and it should be possible to iterate over all
256256
"""
257257
n = NodeManager(startup_nodes=[{"host": "127.0.0.1", "port": 7000}])
258258
n.initialize()
@@ -266,7 +266,7 @@ def test_all_nodes():
266266
def test_all_nodes_masters():
267267
"""
268268
Set a list of nodes with random masters/slaves config and it shold be possible
269-
to itterate over all of them.
269+
to iterate over all of them.
270270
"""
271271
n = NodeManager(
272272
startup_nodes=[

tests/test_commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def cleanup():
3939

4040
def redis_server_time(client):
4141
"""
42-
Method adapted from uptream to return the server timestamp from the main
42+
Method adapted from upstream to return the server timestamp from the main
4343
cluster node that we assigned as port 7000 node.
4444
This is not ideal but will be done for now.
4545
"""
@@ -1987,15 +1987,15 @@ def test_cluster_slaves(self, mock_cluster_resp_slaves):
19871987
@skip_for_no_cluster_impl()
19881988
def test_readwrite(self, r):
19891989
"""
1990-
FIXME: Needs cluster impelmentation
1990+
FIXME: Needs cluster implementation
19911991
"""
19921992
assert r.readwrite()
19931993

19941994
@skip_if_server_version_lt('3.0.0')
19951995
@skip_for_no_cluster_impl()
19961996
def test_readonly_invalid_cluster_state(self, r):
19971997
"""
1998-
FIXME: Needs cluster impelmentation
1998+
FIXME: Needs cluster implementation
19991999
"""
20002000
with pytest.raises(exceptions.RedisError):
20012001
r.readonly()
@@ -2004,7 +2004,7 @@ def test_readonly_invalid_cluster_state(self, r):
20042004
@skip_for_no_cluster_impl()
20052005
def test_readonly(self, mock_cluster_resp_ok):
20062006
"""
2007-
FIXME: Needs cluster impelmentation
2007+
FIXME: Needs cluster implementation
20082008
"""
20092009
assert mock_cluster_resp_ok.readonly() is True
20102010

0 commit comments

Comments
 (0)