diff options
author | Avital Fine <79420960+AvitalFineRedis@users.noreply.github.com> | 2021-10-14 15:23:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 15:23:29 +0200 |
commit | 86b89764781b2e898eb92aed6e33cbafcfd6157b (patch) | |
tree | 1e48849e7fe016557e03d7b0a9dfa8d438f62f39 | |
parent | 4a973136c1ec28cb86871e46c4f5336aaa7901b7 (diff) | |
parent | 5fb24c43af334d16878c0db5104270a76e73f188 (diff) | |
download | redis-py-86b89764781b2e898eb92aed6e33cbafcfd6157b.tar.gz |
Merge pull request #1608 from AvitalFineRedis/MEMORY_DOCTOR
Throw NotImplementedError for MEMORY DOCTOR and MEMORY HELP
-rw-r--r-- | redis/commands.py | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/redis/commands.py b/redis/commands.py index bc80507..7bb6b50 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -373,7 +373,7 @@ class Commands: return self.execute_command('CLIENT LIST', *args) def client_getname(self): - "Returns the current connection name" + """Returns the current connection name""" return self.execute_command('CLIENT GETNAME') def client_reply(self, reply): @@ -396,11 +396,12 @@ class Commands: return self.execute_command("CLIENT REPLY", reply) def client_id(self): - "Returns the current connection id" + """Returns the current connection id""" return self.execute_command('CLIENT ID') def client_trackinginfo(self): - """Returns the information about the current client connection's + """ + Returns the information about the current client connection's use of the server assisted client side cache. See https://redis.io/commands/client-trackinginfo """ @@ -438,15 +439,19 @@ class Commands: return self.execute_command('CLIENT UNPAUSE') def readwrite(self): - "Disables read queries for a connection to a Redis Cluster slave node" + """ + Disables read queries for a connection to a Redis Cluster slave node. + """ return self.execute_command('READWRITE') def readonly(self): - "Enables read queries for a connection to a Redis Cluster replica node" + """ + Enables read queries for a connection to a Redis Cluster replica node. + """ return self.execute_command('READONLY') def config_get(self, pattern="*"): - "Return a dictionary of configuration based on the ``pattern``" + """Return a dictionary of configuration based on the ``pattern``""" return self.execute_command('CONFIG GET', pattern) def config_set(self, name, value): @@ -454,23 +459,25 @@ class Commands: return self.execute_command('CONFIG SET', name, value) def config_resetstat(self): - "Reset runtime statistics" + """Reset runtime statistics""" return self.execute_command('CONFIG RESETSTAT') def config_rewrite(self): - "Rewrite config file with the minimal change to reflect running config" + """ + Rewrite config file with the minimal change to reflect running config. + """ return self.execute_command('CONFIG REWRITE') def dbsize(self): - "Returns the number of keys in the current database" + """Returns the number of keys in the current database""" return self.execute_command('DBSIZE') def debug_object(self, key): - "Returns version specific meta information about a given key" + """Returns version specific meta information about a given key""" return self.execute_command('DEBUG OBJECT', key) def echo(self, value): - "Echo the string back from the server" + """Echo the string back from the server""" return self.execute_command('ECHO', value) def flushall(self, asynchronous=False): @@ -524,7 +531,8 @@ class Commands: return self.execute_command('LASTSAVE') def lolwut(self, *version_numbers): - """Get the Redis version and a piece of generative computer art + """ + Get the Redis version and a piece of generative computer art See: https://redis.io/commands/lolwut """ if version_numbers: @@ -568,11 +576,21 @@ class Commands: timeout, *pieces) def object(self, infotype, key): - "Return the encoding, idletime, or refcount about the key" + """Return the encoding, idletime, or refcount about the key""" return self.execute_command('OBJECT', infotype, key, infotype=infotype) + def memory_doctor(self): + raise NotImplementedError( + "MEMORY DOCTOR is intentionally not implemented in the client." + ) + + def memory_help(self): + raise NotImplementedError( + "MEMORY HELP is intentionally not implemented in the client." + ) + def memory_stats(self): - "Return a dictionary of memory stats" + """Return a dictionary of memory stats""" return self.execute_command('MEMORY STATS') def memory_usage(self, key, samples=None): @@ -590,15 +608,16 @@ class Commands: return self.execute_command('MEMORY USAGE', key, *args) def memory_purge(self): - "Attempts to purge dirty pages for reclamation by allocator" + """Attempts to purge dirty pages for reclamation by allocator""" return self.execute_command('MEMORY PURGE') def ping(self): - "Ping the Redis server" + """Ping the Redis server""" return self.execute_command('PING') def quit(self): - """Ask the server to close the connection. + """ + Ask the server to close the connection. https://redis.io/commands/quit """ return self.execute_command('QUIT') |