Skip to content

HashClient

Bases: Connection, Geo, Hash, HyperLogLog, Key, List, Publish, Scripting, Set, SSet, String, Transaction

Synchronous Redis Client Hashing across multiple buckets.

Determines connection socket for a command by calculating the keyspace slot from the shard_key and mapping it to one of the configured server buckets.

Source code in pyredis/client/hash.py
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
class HashClient(
    commands.Connection,
    commands.Geo,
    commands.Hash,
    commands.HyperLogLog,
    commands.Key,
    commands.List,
    commands.Publish,
    commands.Scripting,
    commands.Set,
    commands.SSet,
    commands.String,
    commands.Transaction,
):
    """
    Synchronous Redis Client Hashing across multiple buckets.

    Determines connection socket for a command by calculating the keyspace slot from 
    the shard_key and mapping it to one of the configured server buckets.
    """

    def __init__(
        self,
        buckets,
        database=None,
        password=None,
        encoding=None,
        conn_timeout=2,
        read_timeout=2,
        username=None,
    ):
        """
        Initialize the HashClient.

        Args:
            buckets: List of (host, port) tuples representing the server buckets.
            database: Optional Redis database index.
            password: Optional password for Redis authentication.
            encoding: Optional string encoding for decoding responses.
            conn_timeout: Connection timeout in seconds.
            read_timeout: Read timeout in seconds.
            username: Optional username for Redis ACL authentication.
        """
        super().__init__()
        self._conns = dict()
        self._conn_names = list()
        self._bulk = False
        self._bulk_keep = False
        self._bulk_results = None
        self._bulk_size = None
        self._bulk_size_current = None
        self._bulk_bucket_order = list()
        self._closed = False
        self._cluster = True
        self._map = dict()
        self._init_conns(
            buckets=buckets,
            database=database,
            password=password,
            encoding=encoding,
            conn_timeout=conn_timeout,
            read_timeout=read_timeout,
            username=username,
        )
        self._init_map()

    def _bulk_fetch(self):
        for conn in self._bulk_bucket_order:
            result = conn.read(raise_on_result_err=False)
            if self._bulk_keep:
                self._bulk_results.append(result)
        self._bulk_bucket_order = list()
        self._bulk_size_current = 0

    @staticmethod
    def _execute_basic(*args, conn):
        conn.write(*args)
        return conn.read()

    def _execute_bulk(self, *args, conn):
        conn.write(*args)
        self._bulk_size_current += 1
        self._bulk_bucket_order.append(conn)
        if self._bulk_size_current == self._bulk_size:
            self._bulk_fetch()

    def _init_conns(
        self,
        buckets,
        database,
        password,
        encoding,
        conn_timeout,
        read_timeout,
        username,
    ):
        for bucket in buckets:
            host, port = bucket
            bucketname = f"{host}_{port}"
            self._conn_names.append(bucketname)
            self._conns[bucketname] = pyredis.client.Connection(
                host=host,
                port=port,
                database=database,
                password=password,
                encoding=encoding,
                conn_timeout=conn_timeout,
                read_timeout=read_timeout,
                username=username,
            )

    def _init_map(self):
        num_buckets = len(self._conn_names) - 1
        cur_bucket = 0
        for slot in range(16384):
            self._map[slot] = self._conn_names[cur_bucket]
            if cur_bucket == num_buckets:
                cur_bucket = 0
            else:
                cur_bucket += 1

    @property
    def bulk(self):
        """Flag indicating if bulk mode is active."""
        return self._bulk

    def bulk_start(self, bulk_size=5000, keep_results=True):
        """
        Start bulk command pipelining mode.

        Args:
            bulk_size: Maximum commands to queue before reading responses.
            keep_results: Flag indicating if responses should be returned.
        """
        if self.bulk:
            raise PyRedisError("Already in bulk mode")
        self._bulk = True
        self._bulk_size = bulk_size
        self._bulk_size_current = 0
        if keep_results:
            self._bulk_results = []
            self._bulk_keep = True

    def bulk_stop(self):
        """
        Stop bulk mode and retrieve results.

        Returns:
            List of execution results if keep_results was set.
        """
        if not self.bulk:
            raise PyRedisError("Not in bulk mode")
        self._bulk_fetch()
        results = self._bulk_results
        self._bulk = False
        self._bulk_keep = False
        self._bulk_results = None
        self._bulk_size = None
        self._bulk_size_current = None
        return results

    def close(self):
        """Close all connections to the server buckets."""
        for conn in self._conns.values():
            conn.close()
        self._closed = True

    @property
    def closed(self):
        """Flag indicating if the client connections are closed."""
        return self._closed

    def execute(self, *args, shard_key=None, sock=None):
        """
        Execute a command on the appropriate bucket.

        Args:
            *args: Command name and arguments.
            shard_key: Key used to calculate the slot and route the command.
            sock: Optional explicit socket name/bucket to route to.

        Returns:
            The Redis command response, or None if in bulk mode.
        """
        if not bool(shard_key) != bool(sock):
            raise PyRedisError("Ether shard_key or sock has to be provided")
        if not sock:
            sock = self._map[slot_from_key(shard_key)]
        conn = self._conns[sock]
        try:
            if not self._bulk:
                return self._execute_basic(
                    *args,
                    conn=conn
                )
            else:
                self._execute_bulk(
                    *args,
                    conn=conn
                )
        except PyRedisConnError as err:
            self.close()
            raise err

bulk property

Flag indicating if bulk mode is active.

closed property

Flag indicating if the client connections are closed.

__init__(buckets, database=None, password=None, encoding=None, conn_timeout=2, read_timeout=2, username=None)

Initialize the HashClient.

Parameters:

Name Type Description Default
buckets

List of (host, port) tuples representing the server buckets.

required
database

Optional Redis database index.

None
password

Optional password for Redis authentication.

None
encoding

Optional string encoding for decoding responses.

None
conn_timeout

Connection timeout in seconds.

2
read_timeout

Read timeout in seconds.

2
username

Optional username for Redis ACL authentication.

None
Source code in pyredis/client/hash.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
def __init__(
    self,
    buckets,
    database=None,
    password=None,
    encoding=None,
    conn_timeout=2,
    read_timeout=2,
    username=None,
):
    """
    Initialize the HashClient.

    Args:
        buckets: List of (host, port) tuples representing the server buckets.
        database: Optional Redis database index.
        password: Optional password for Redis authentication.
        encoding: Optional string encoding for decoding responses.
        conn_timeout: Connection timeout in seconds.
        read_timeout: Read timeout in seconds.
        username: Optional username for Redis ACL authentication.
    """
    super().__init__()
    self._conns = dict()
    self._conn_names = list()
    self._bulk = False
    self._bulk_keep = False
    self._bulk_results = None
    self._bulk_size = None
    self._bulk_size_current = None
    self._bulk_bucket_order = list()
    self._closed = False
    self._cluster = True
    self._map = dict()
    self._init_conns(
        buckets=buckets,
        database=database,
        password=password,
        encoding=encoding,
        conn_timeout=conn_timeout,
        read_timeout=read_timeout,
        username=username,
    )
    self._init_map()

append(*args)

Source code in pyredis/commands/string.py
10
11
12
13
14
15
16
17
18
def append(self, *args):
    if self._cluster:
        return self.execute(
            *[b"APPEND", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"APPEND", *args]
    )

bitcount(*args)

Source code in pyredis/commands/string.py
20
21
22
23
24
25
26
27
28
def bitcount(self, *args):
    if self._cluster:
        return self.execute(
            *[b"BITCOUNT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"BITCOUNT", *args]
    )

bitfield(*args)

Source code in pyredis/commands/string.py
30
31
32
33
34
35
36
37
38
def bitfield(self, *args):
    if self._cluster:
        return self.execute(
            *[b"BITFIELD", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"BITFIELD", *args]
    )

bitop(*args)

Source code in pyredis/commands/string.py
40
41
42
43
44
45
46
47
48
def bitop(self, *args):
    if self._cluster:
        return self.execute(
            *[b"BITOP", *args],
            shard_key=args[1]
        )
    return self.execute(
        *[b"BITOP", *args]
    )

bitpos(*args)

Source code in pyredis/commands/string.py
50
51
52
53
54
55
56
57
58
def bitpos(self, *args):
    if self._cluster:
        return self.execute(
            *[b"BITPOS", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"BITPOS", *args]
    )

blpop(*args)

Source code in pyredis/commands/list.py
10
11
12
13
14
15
16
17
18
def blpop(self, *args):
    if self._cluster:
        return self.execute(
            *[b"BLPOP", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"BLPOP", *args]
    )

brpop(*args)

Source code in pyredis/commands/list.py
20
21
22
23
24
25
26
27
28
def brpop(self, *args):
    if self._cluster:
        return self.execute(
            *[b"BRPOP", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"BRPOP", *args]
    )

brpoplpush(*args)

Source code in pyredis/commands/list.py
30
31
32
33
34
35
36
37
38
def brpoplpush(self, *args):
    if self._cluster:
        return self.execute(
            *[b"BRPOPPUSH", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"BRPOPPUSH", *args]
    )

bulk_start(bulk_size=5000, keep_results=True)

Start bulk command pipelining mode.

Parameters:

Name Type Description Default
bulk_size

Maximum commands to queue before reading responses.

5000
keep_results

Flag indicating if responses should be returned.

True
Source code in pyredis/client/hash.py
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
def bulk_start(self, bulk_size=5000, keep_results=True):
    """
    Start bulk command pipelining mode.

    Args:
        bulk_size: Maximum commands to queue before reading responses.
        keep_results: Flag indicating if responses should be returned.
    """
    if self.bulk:
        raise PyRedisError("Already in bulk mode")
    self._bulk = True
    self._bulk_size = bulk_size
    self._bulk_size_current = 0
    if keep_results:
        self._bulk_results = []
        self._bulk_keep = True

bulk_stop()

Stop bulk mode and retrieve results.

Returns:

Type Description

List of execution results if keep_results was set.

Source code in pyredis/client/hash.py
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
def bulk_stop(self):
    """
    Stop bulk mode and retrieve results.

    Returns:
        List of execution results if keep_results was set.
    """
    if not self.bulk:
        raise PyRedisError("Not in bulk mode")
    self._bulk_fetch()
    results = self._bulk_results
    self._bulk = False
    self._bulk_keep = False
    self._bulk_results = None
    self._bulk_size = None
    self._bulk_size_current = None
    return results

close()

Close all connections to the server buckets.

Source code in pyredis/client/hash.py
169
170
171
172
173
def close(self):
    """Close all connections to the server buckets."""
    for conn in self._conns.values():
        conn.close()
    self._closed = True

decr(*args)

Source code in pyredis/commands/string.py
60
61
62
63
64
65
66
67
68
def decr(self, *args):
    if self._cluster:
        return self.execute(
            *[b"DECR", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"DECR", *args]
    )

decrby(*args)

Source code in pyredis/commands/string.py
70
71
72
73
74
75
76
77
78
def decrby(self, *args):
    if self._cluster:
        return self.execute(
            *[b"DECRBY", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"DECRBY", *args]
    )

delete(*args)

Source code in pyredis/commands/key.py
10
11
12
13
14
15
16
17
18
def delete(self, *args):
    if self._cluster:
        return self.execute(
            *[b"DEL", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"DEL", *args]
    )

discard(*args, shard_key=None, sock=None)

Source code in pyredis/commands/transaction.py
10
11
12
13
14
15
16
17
18
19
def discard(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"DISCARD", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"DISCARD", *args]
    )

dump(*args)

Source code in pyredis/commands/key.py
20
21
22
23
24
25
26
27
28
def dump(self, *args):
    if self._cluster:
        return self.execute(
            *[b"DUMP", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"DUMP", *args]
    )

echo(*args, shard_key=None, sock=None)

Source code in pyredis/commands/connection.py
10
11
12
13
14
15
16
17
18
19
def echo(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"ECHO", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"ECHO", *args]
    )

eval(*args, shard_key=None, sock=None)

Source code in pyredis/commands/scripting.py
10
11
12
13
14
15
16
17
18
19
def eval(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"EVAL", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"EVAL", *args]
    )

evalsha(*args, shard_key=None, sock=None)

Source code in pyredis/commands/scripting.py
21
22
23
24
25
26
27
28
29
30
def evalsha(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"EVALSHA", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"EVALSHA", *args]
    )

exec(*args, shard_key=None, sock=None)

Source code in pyredis/commands/transaction.py
21
22
23
24
25
26
27
28
29
30
def exec(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"EXEC", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"EXEC", *args]
    )

execute(*args, shard_key=None, sock=None)

Execute a command on the appropriate bucket.

Parameters:

Name Type Description Default
*args

Command name and arguments.

()
shard_key

Key used to calculate the slot and route the command.

None
sock

Optional explicit socket name/bucket to route to.

None

Returns:

Type Description

The Redis command response, or None if in bulk mode.

Source code in pyredis/client/hash.py
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
def execute(self, *args, shard_key=None, sock=None):
    """
    Execute a command on the appropriate bucket.

    Args:
        *args: Command name and arguments.
        shard_key: Key used to calculate the slot and route the command.
        sock: Optional explicit socket name/bucket to route to.

    Returns:
        The Redis command response, or None if in bulk mode.
    """
    if not bool(shard_key) != bool(sock):
        raise PyRedisError("Ether shard_key or sock has to be provided")
    if not sock:
        sock = self._map[slot_from_key(shard_key)]
    conn = self._conns[sock]
    try:
        if not self._bulk:
            return self._execute_basic(
                *args,
                conn=conn
            )
        else:
            self._execute_bulk(
                *args,
                conn=conn
            )
    except PyRedisConnError as err:
        self.close()
        raise err

exists(*args)

Source code in pyredis/commands/key.py
30
31
32
33
34
35
36
37
38
def exists(self, *args):
    if self._cluster:
        return self.execute(
            *[b"EXISTS", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"EXISTS", *args]
    )

expire(*args)

Source code in pyredis/commands/key.py
40
41
42
43
44
45
46
47
48
def expire(self, *args):
    if self._cluster:
        return self.execute(
            *[b"EXPIRE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"EXPIRE", *args]
    )

expireat(*args)

Source code in pyredis/commands/key.py
50
51
52
53
54
55
def expireat(self, *args):
    if self._cluster:
        return self.execute(b"EXPIREAT")
    return self.execute(
        *[b"EXPIREAT", *args]
    )

geoadd(*args)

Source code in pyredis/commands/geo.py
10
11
12
13
14
15
16
17
18
def geoadd(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GEOADD", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GEOADD", *args]
    )

geodist(*args)

Source code in pyredis/commands/geo.py
20
21
22
23
24
25
26
27
28
def geodist(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GEODIST", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GEODIST", *args]
    )

geohash(*args)

Source code in pyredis/commands/geo.py
30
31
32
33
34
35
36
37
38
def geohash(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GEOHASH", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GEOHASH", *args]
    )

geopos(*args)

Source code in pyredis/commands/geo.py
50
51
52
53
54
55
56
57
58
def geopos(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GEOPOS", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GEOPOS", *args]
    )

georadius(*args)

Source code in pyredis/commands/geo.py
40
41
42
43
44
45
46
47
48
def georadius(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GEORADIUS", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GEORADIUS", *args]
    )

georadiusbymember(*args)

Source code in pyredis/commands/geo.py
60
61
62
63
64
65
66
67
68
def georadiusbymember(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GEORADIUSBYMEMBER", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GEORADIUSBYMEMBER", *args]
    )

get(*args)

Source code in pyredis/commands/string.py
80
81
82
83
84
85
86
87
88
def get(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GET", *args]
    )

getbit(*args)

Source code in pyredis/commands/string.py
90
91
92
93
94
95
96
97
98
def getbit(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GETBIT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GETBIT", *args]
    )

getrange(*args)

Source code in pyredis/commands/string.py
100
101
102
103
104
105
106
107
108
def getrange(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GETRANGE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GETRANGE", *args]
    )

getset(*args)

Source code in pyredis/commands/string.py
110
111
112
113
114
115
116
117
118
def getset(self, *args):
    if self._cluster:
        return self.execute(
            *[b"GETSET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"GETSET", *args]
    )

hdel(*args)

Source code in pyredis/commands/hash.py
10
11
12
13
14
15
16
17
18
def hdel(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HDEL", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HDEL", *args]
    )

hexists(*args)

Source code in pyredis/commands/hash.py
20
21
22
23
24
25
26
27
28
def hexists(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HEXISTS", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HEXISTS", *args]
    )

hget(*args)

Source code in pyredis/commands/hash.py
30
31
32
33
34
35
36
37
38
def hget(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HGET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HGET", *args]
    )

hgetall(*args)

Source code in pyredis/commands/hash.py
40
41
42
43
44
45
46
47
48
def hgetall(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HGETALL", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HGETALL", *args]
    )

hincrby(*args)

Source code in pyredis/commands/hash.py
50
51
52
53
54
55
56
57
58
def hincrby(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HINCRBY", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HINCRBY", *args]
    )

hincrbyfloat(*args)

Source code in pyredis/commands/hash.py
60
61
62
63
64
65
66
67
68
def hincrbyfloat(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HINCRBYFLOAT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HINCRBYFLOAT", *args]
    )

hkeys(*args)

Source code in pyredis/commands/hash.py
70
71
72
73
74
75
76
77
78
def hkeys(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HKEYS", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HKEYS", *args]
    )

hlen(*args)

Source code in pyredis/commands/hash.py
80
81
82
83
84
85
86
87
88
def hlen(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HLEN", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HLEN", *args]
    )

hmget(*args)

Source code in pyredis/commands/hash.py
90
91
92
93
94
95
96
97
98
def hmget(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HMGET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HMGET", *args]
    )

hmset(*args)

Source code in pyredis/commands/hash.py
100
101
102
103
104
105
106
107
108
def hmset(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HMSET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HMSET", *args]
    )

hscan(*args)

Source code in pyredis/commands/hash.py
150
151
152
153
154
155
156
157
158
def hscan(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HSCAN", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HSCAN", *args]
    )

hset(*args)

Source code in pyredis/commands/hash.py
110
111
112
113
114
115
116
117
118
def hset(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HSET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HSET", *args]
    )

hsetnx(*args)

Source code in pyredis/commands/hash.py
120
121
122
123
124
125
126
127
128
def hsetnx(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HSETNX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HSETNX", *args]
    )

hstrlen(*args)

Source code in pyredis/commands/hash.py
130
131
132
133
134
135
136
137
138
def hstrlen(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HSTRLEN", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HSTRLEN", *args]
    )

hvals(*args)

Source code in pyredis/commands/hash.py
140
141
142
143
144
145
146
147
148
def hvals(self, *args):
    if self._cluster:
        return self.execute(
            *[b"HVALS", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"HVALS", *args]
    )

incr(*args)

Source code in pyredis/commands/string.py
120
121
122
123
124
125
126
127
128
def incr(self, *args):
    if self._cluster:
        return self.execute(
            *[b"INCR", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"INCR", *args]
    )

incrby(*args)

Source code in pyredis/commands/string.py
130
131
132
133
134
135
136
137
138
def incrby(self, *args):
    if self._cluster:
        return self.execute(
            *[b"INCRBY", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"INCRBY", *args]
    )

incrbyfloat(*args)

Source code in pyredis/commands/string.py
140
141
142
143
144
145
146
147
148
def incrbyfloat(self, *args):
    if self._cluster:
        return self.execute(
            *[b"INCRBYFLOAT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"INCRBYFLOAT", *args]
    )

keys(*args, shard_key=None, sock=None)

Source code in pyredis/commands/key.py
57
58
59
60
61
62
63
64
65
66
def keys(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"KEYS", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"KEYS", *args]
    )

lindex(*args)

Source code in pyredis/commands/list.py
40
41
42
43
44
45
46
47
48
def lindex(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LINDEX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LINDEX", *args]
    )

linsert(*args)

Source code in pyredis/commands/list.py
50
51
52
53
54
55
56
57
58
def linsert(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LINSERT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LINSERT", *args]
    )

llen(*args)

Source code in pyredis/commands/list.py
60
61
62
63
64
65
66
67
68
def llen(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LLEN", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LLEN", *args]
    )

lpop(*args)

Source code in pyredis/commands/list.py
70
71
72
73
74
75
76
77
78
def lpop(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LPOP", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LPOP", *args]
    )

lpush(*args)

Source code in pyredis/commands/list.py
80
81
82
83
84
85
86
87
88
def lpush(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LPUSH", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LPUSH", *args]
    )

lpushx(*args)

Source code in pyredis/commands/list.py
90
91
92
93
94
95
96
97
98
def lpushx(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LPUSHX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LPUSHX", *args]
    )

lrange(*args)

Source code in pyredis/commands/list.py
100
101
102
103
104
105
106
107
108
def lrange(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LRANGE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LRANGE", *args]
    )

lrem(*args)

Source code in pyredis/commands/list.py
110
111
112
113
114
115
116
117
118
def lrem(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LREM", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LREM", *args]
    )

lset(*args)

Source code in pyredis/commands/list.py
120
121
122
123
124
125
126
127
128
def lset(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LSET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LSET", *args]
    )

ltrim(*args)

Source code in pyredis/commands/list.py
130
131
132
133
134
135
136
137
138
def ltrim(self, *args):
    if self._cluster:
        return self.execute(
            *[b"LTRIM", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"LTRIM", *args]
    )

mget(*args)

Source code in pyredis/commands/string.py
150
151
152
153
154
155
156
157
158
def mget(self, *args):
    if self._cluster:
        return self.execute(
            *[b"MGET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"MGET", *args]
    )

migrate(*args)

Source code in pyredis/commands/key.py
68
69
70
71
72
73
def migrate(self, *args):
    if self._cluster:
        raise NotImplementedError
    return self.execute(
        *[b"MIGRATE", *args]
    )

move(*args)

Source code in pyredis/commands/key.py
75
76
77
78
79
80
81
82
83
def move(self, *args):
    if self._cluster:
        return self.execute(
            *[b"MOVE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"MOVE", *args]
    )

mset(*args)

Source code in pyredis/commands/string.py
160
161
162
163
164
165
166
167
168
def mset(self, *args):
    if self._cluster:
        return self.execute(
            *[b"MSET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"MSET", *args]
    )

msetnx(*args)

Source code in pyredis/commands/string.py
170
171
172
173
174
175
176
177
178
def msetnx(self, *args):
    if self._cluster:
        return self.execute(
            *[b"MSETNX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"MSETNX", *args]
    )

multi(*args, shard_key=None, sock=None)

Source code in pyredis/commands/transaction.py
32
33
34
35
36
37
38
39
40
41
def multi(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"MULTI", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"MULTI", *args]
    )

object(*args, shard_key=None, sock=None)

Source code in pyredis/commands/key.py
85
86
87
88
89
90
91
92
93
94
def object(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"DEL", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"OBJECT", *args]
    )

persist(*args)

Source code in pyredis/commands/key.py
 96
 97
 98
 99
100
101
102
103
104
def persist(self, *args):
    if self._cluster:
        return self.execute(
            *[b"PERSIST", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"PERSIST", *args]
    )

pexpire(*args)

Source code in pyredis/commands/key.py
106
107
108
109
110
111
112
113
114
def pexpire(self, *args):
    if self._cluster:
        return self.execute(
            *[b"PEXPIRE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"PEXPIRE", *args]
    )

pexpireat(*args)

Source code in pyredis/commands/key.py
116
117
118
119
120
121
122
123
124
def pexpireat(self, *args):
    if self._cluster:
        return self.execute(
            *[b"PEXPIREAT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"PEXPIREAT", *args]
    )

pfadd(*args)

Source code in pyredis/commands/hyperloglog.py
10
11
12
13
14
15
16
17
18
def pfadd(self, *args):
    if self._cluster:
        return self.execute(
            *[b"PFADD", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"PFADD", *args]
    )

pfcount(*args)

Source code in pyredis/commands/hyperloglog.py
20
21
22
23
24
25
26
27
28
def pfcount(self, *args):
    if self._cluster:
        return self.execute(
            *[b"PFCOUNT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"PFCOUNT", *args]
    )

pfmerge(*args)

Source code in pyredis/commands/hyperloglog.py
30
31
32
33
34
35
36
37
38
def pfmerge(self, *args):
    if self._cluster:
        return self.execute(
            *[b"PFMERGE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"PFMERGE", *args]
    )

ping(shard_key=None, sock=None)

Source code in pyredis/commands/connection.py
21
22
23
24
25
26
27
28
def ping(self, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            b"PING",
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(b"PING")

psetex(*args)

Source code in pyredis/commands/string.py
180
181
182
183
184
185
186
187
188
def psetex(self, *args):
    if self._cluster:
        return self.execute(
            *[b"PSETEX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"PSETEX", *args]
    )

pttl(*args)

Source code in pyredis/commands/key.py
126
127
128
129
130
131
132
133
134
def pttl(self, *args):
    if self._cluster:
        return self.execute(
            *[b"PTTL", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"PTTL", *args]
    )

publish(*args)

Source code in pyredis/commands/publish.py
10
11
12
13
14
15
def publish(self, *args):
    if self._cluster:
        raise NotImplementedError
    return self.execute(
        *[b"PUBLISH", *args]
    )

randomkey(*args, shard_key=None, sock=None)

Source code in pyredis/commands/key.py
136
137
138
139
140
141
142
143
144
145
def randomkey(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"RANDOMKEY", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"RANDOMKEY", *args]
    )

rename(*args)

Source code in pyredis/commands/key.py
147
148
149
150
151
152
153
154
155
def rename(self, *args):
    if self._cluster:
        return self.execute(
            *[b"RENAME", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"RENAME", *args]
    )

renamenx(*args)

Source code in pyredis/commands/key.py
157
158
159
160
161
162
163
164
165
def renamenx(self, *args):
    if self._cluster:
        return self.execute(
            *[b"RENAMENX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"RENAMENX", *args]
    )

restore(*args)

Source code in pyredis/commands/key.py
167
168
169
170
171
172
173
174
175
def restore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"RESTORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"RESTORE", *args]
    )

rpop(*args)

Source code in pyredis/commands/list.py
140
141
142
143
144
145
146
147
148
def rpop(self, *args):
    if self._cluster:
        return self.execute(
            *[b"RPOP", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"RPOP", *args]
    )

rpoplpush(*args)

Source code in pyredis/commands/list.py
150
151
152
153
154
155
156
157
158
def rpoplpush(self, *args):
    if self._cluster:
        return self.execute(
            *[b"RPOPLPUSH", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"RPOPLPUSH", *args]
    )

rpush(*args)

Source code in pyredis/commands/list.py
160
161
162
163
164
165
166
167
168
def rpush(self, *args):
    if self._cluster:
        return self.execute(
            *[b"RPUSH", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"RPUSH", *args]
    )

rpushx(*args)

Source code in pyredis/commands/list.py
170
171
172
173
174
175
176
177
178
def rpushx(self, *args):
    if self._cluster:
        return self.execute(
            *[b"RPUSHX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"RPUSHX", *args]
    )

sadd(*args)

Source code in pyredis/commands/set.py
10
11
12
13
14
15
16
17
18
def sadd(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SADD", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SADD", *args]
    )

scan(*args, shard_key=None, sock=None)

Source code in pyredis/commands/key.py
177
178
179
180
181
182
183
184
185
186
def scan(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"SCAN", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"SCAN", *args]
    )

scard(*args)

Source code in pyredis/commands/set.py
20
21
22
23
24
25
26
27
28
def scard(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SCARD", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SCARD", *args]
    )

script_debug(*args, shard_key=None, sock=None)

Source code in pyredis/commands/scripting.py
32
33
34
35
36
37
38
39
40
41
def script_debug(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"SCRIPT", b"DEBUG", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"SCRIPT", b"DEBUG", *args]
    )

script_exists(*args, shard_key=None, sock=None)

Source code in pyredis/commands/scripting.py
43
44
45
46
47
48
49
50
51
52
def script_exists(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"SCRIPT", b"EXISTS", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"SCRIPT", b"EXISTS", *args]
    )

script_flush(*args, shard_key=None, sock=None)

Source code in pyredis/commands/scripting.py
54
55
56
57
58
59
60
61
62
63
def script_flush(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"SCRIPT", b"FLUSH", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"SCRIPT", b"FLUSH", *args]
    )

script_kill(*args, shard_key=None, sock=None)

Source code in pyredis/commands/scripting.py
65
66
67
68
69
70
71
72
73
74
def script_kill(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"SCRIPT", b"KILL", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"SCRIPT", b"KILL", *args]
    )

script_load(*args, shard_key=None, sock=None)

Source code in pyredis/commands/scripting.py
76
77
78
79
80
81
82
83
84
85
def script_load(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"SCRIPT", b"LOAD", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"SCRIPT", b"LOAD", *args]
    )

sdiff(*args)

Source code in pyredis/commands/set.py
30
31
32
33
34
35
36
37
38
def sdiff(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SDIFF", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SDIFF", *args]
    )

sdiffstore(*args)

Source code in pyredis/commands/set.py
40
41
42
43
44
45
46
47
48
def sdiffstore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SDIFFSTORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SDIFFSTORE", *args]
    )

set(*args)

Source code in pyredis/commands/string.py
190
191
192
193
194
195
196
197
198
def set(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SET", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SET", *args]
    )

setbit(*args)

Source code in pyredis/commands/string.py
200
201
202
203
204
205
206
207
208
def setbit(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SETBIT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SETBIT", *args]
    )

setex(*args)

Source code in pyredis/commands/string.py
210
211
212
213
214
215
216
217
218
def setex(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SETEX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SETEX", *args]
    )

setnx(*args)

Source code in pyredis/commands/string.py
220
221
222
223
224
225
226
227
228
def setnx(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SETNX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SETNX", *args]
    )

setrange(*args)

Source code in pyredis/commands/string.py
230
231
232
233
234
235
236
237
238
def setrange(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SETRANGE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SETRANGE", *args]
    )

sinter(*args)

Source code in pyredis/commands/set.py
50
51
52
53
54
55
56
57
58
def sinter(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SINTER", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SINTER", *args]
    )

sinterstore(*args)

Source code in pyredis/commands/set.py
60
61
62
63
64
65
66
67
68
def sinterstore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SINTERSTORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SINTERSTORE", *args]
    )

sismember(*args)

Source code in pyredis/commands/set.py
70
71
72
73
74
75
76
77
78
def sismember(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SISMEMBER", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SISMEMBER", *args]
    )

smembers(*args)

Source code in pyredis/commands/set.py
80
81
82
83
84
85
86
87
88
def smembers(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SMEMBERS", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SMEMBERS", *args]
    )

smove(*args)

Source code in pyredis/commands/set.py
90
91
92
93
94
95
96
97
98
def smove(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SMOVE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SMOVE", *args]
    )

sort(*args)

Source code in pyredis/commands/key.py
188
189
190
191
192
193
194
195
196
def sort(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SORT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SORT", *args]
    )

spop(*args)

Source code in pyredis/commands/set.py
100
101
102
103
104
105
106
107
108
def spop(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SPOP", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SPOP", *args]
    )

srandmember(*args)

Source code in pyredis/commands/set.py
110
111
112
113
114
115
116
117
118
def srandmember(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SRANDMEMBER", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SRANDMEMBER", *args]
    )

srem(*args)

Source code in pyredis/commands/set.py
120
121
122
123
124
125
126
127
128
def srem(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SREM", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SREM", *args]
    )

sscan(*args)

Source code in pyredis/commands/set.py
150
151
152
153
154
155
156
157
158
def sscan(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SSCAN", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SSCAN", *args]
    )

strlen(*args)

Source code in pyredis/commands/string.py
240
241
242
243
244
245
246
247
248
def strlen(self, *args):
    if self._cluster:
        return self.execute(
            *[b"STRLEN", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"STRLEN", *args]
    )

sunion(*args)

Source code in pyredis/commands/set.py
130
131
132
133
134
135
136
137
138
def sunion(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SUNION", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SUNION", *args]
    )

sunoinstore(*args)

Source code in pyredis/commands/set.py
140
141
142
143
144
145
146
147
148
def sunoinstore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"SUNIONSTORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"SUNIONSTORE", *args]
    )

ttl(*args)

Source code in pyredis/commands/key.py
198
199
200
201
202
203
204
205
206
def ttl(self, *args):
    if self._cluster:
        return self.execute(
            *[b"TTL", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"TTL", *args]
    )

type(*args)

Source code in pyredis/commands/key.py
208
209
210
211
212
213
214
215
216
def type(self, *args):
    if self._cluster:
        return self.execute(
            *[b"TYPE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"TYPE", *args]
    )

unwatch(*args, shard_key=None, sock=None)

Source code in pyredis/commands/transaction.py
43
44
45
46
47
48
49
50
51
52
def unwatch(self, *args, shard_key=None, sock=None):
    if self._cluster:
        return self.execute(
            *[b"UNWATCH", *args],
            shard_key=shard_key,
            sock=sock
        )
    return self.execute(
        *[b"UNWATCH", *args]
    )

wait(*args)

Source code in pyredis/commands/key.py
218
219
220
221
222
223
224
225
226
def wait(self, *args):
    if self._cluster:
        return self.execute(
            *[b"WAIT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"WAIT", *args]
    )

watch(*args)

Source code in pyredis/commands/transaction.py
54
55
56
57
58
59
60
61
62
def watch(self, *args):
    if self._cluster:
        return self.execute(
            *[b"WATCH", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"WATCH", *args]
    )

zadd(*args)

Source code in pyredis/commands/sset.py
10
11
12
13
14
15
16
17
18
def zadd(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZADD", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZADD", *args]
    )

zcard(*args)

Source code in pyredis/commands/sset.py
20
21
22
23
24
25
26
27
28
def zcard(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZCARD", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZCARD", *args]
    )

zcount(*args)

Source code in pyredis/commands/sset.py
30
31
32
33
34
35
36
37
38
def zcount(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZCOUNT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZCOUNT", *args]
    )

zincrby(*args)

Source code in pyredis/commands/sset.py
40
41
42
43
44
45
46
47
48
def zincrby(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZINCRBY", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZINCRBY", *args]
    )

zinterstore(*args)

Source code in pyredis/commands/sset.py
50
51
52
53
54
55
56
57
58
def zinterstore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZINTERSTORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZINTERSTORE", *args]
    )

zlexcount(*args)

Source code in pyredis/commands/sset.py
60
61
62
63
64
65
66
67
68
def zlexcount(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZLEXCOUNT", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZLEXCOUNT", *args]
    )

zrange(*args)

Source code in pyredis/commands/sset.py
70
71
72
73
74
75
76
77
78
def zrange(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZRANGE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZRANGE", *args]
    )

zrangebylex(*args)

Source code in pyredis/commands/sset.py
80
81
82
83
84
85
86
87
88
def zrangebylex(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZRANGEBYLEX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZRANGEBYLEX", *args]
    )

zrangebyscore(*args)

Source code in pyredis/commands/sset.py
90
91
92
93
94
95
96
97
98
def zrangebyscore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZRANGEBYSCORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZRANGEBYSCORE", *args]
    )

zrank(*args)

Source code in pyredis/commands/sset.py
100
101
102
103
104
105
106
107
108
def zrank(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZRANK", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZRANK", *args]
    )

zrem(*args)

Source code in pyredis/commands/sset.py
110
111
112
113
114
115
116
117
118
def zrem(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZREM", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZREM", *args]
    )

zremrangebylex(*args)

Source code in pyredis/commands/sset.py
120
121
122
123
124
125
126
127
128
def zremrangebylex(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZREMRANGEBYLEX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZREMRANGEBYLEX", *args]
    )

zremrangebyrank(*args)

Source code in pyredis/commands/sset.py
130
131
132
133
134
135
136
137
138
def zremrangebyrank(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZREMRANGEBYRANK", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZREMRANGEBYRANK", *args]
    )

zremrangebyscrore(*args)

Source code in pyredis/commands/sset.py
140
141
142
143
144
145
146
147
148
def zremrangebyscrore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZREMRANGEBYSCORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZREMRANGEBYSCORE", *args]
    )

zrevrange(*args)

Source code in pyredis/commands/sset.py
150
151
152
153
154
155
156
157
158
def zrevrange(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZREVRANGE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZREVRANGE", *args]
    )

zrevrangebylex(*args)

Source code in pyredis/commands/sset.py
160
161
162
163
164
165
166
167
168
def zrevrangebylex(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZREVRANGEBYLEX", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZREVRANGEBYLEX", *args]
    )

zrevrangebyscore(*args)

Source code in pyredis/commands/sset.py
170
171
172
173
174
175
176
177
178
def zrevrangebyscore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZREVRANGEBYSCORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZREVRANGEBYSCORE", *args]
    )

zrevrank(*args)

Source code in pyredis/commands/sset.py
180
181
182
183
184
185
186
187
188
def zrevrank(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZREVRANK", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZREVRANK", *args]
    )

zscan(*args)

Source code in pyredis/commands/sset.py
210
211
212
213
214
215
216
217
218
def zscan(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZSCAN", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZSCAN", *args]
    )

zscore(*args)

Source code in pyredis/commands/sset.py
190
191
192
193
194
195
196
197
198
def zscore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZSCORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZSCORE", *args]
    )

zunionstore(*args)

Source code in pyredis/commands/sset.py
200
201
202
203
204
205
206
207
208
def zunionstore(self, *args):
    if self._cluster:
        return self.execute(
            *[b"ZUNIONSTORE", *args],
            shard_key=args[0]
        )
    return self.execute(
        *[b"ZUNIONSTORE", *args]
    )