Skip to content

Commit df45cc8

Browse files
authored
Apply policies for normal and pipeline mode (#3818)
* Added poilcy resolution method * Moved main command proceessing on top * Fixed return type and keyless detection * Added Dynamic and Static policies * Added coverage for policy resolvers * Applied request policies * Removed all policies except search (phase 1) * Policy applied for normal and pipeline mode * Added assertion with core command * Applied comments * Renamed method
1 parent bb38ff0 commit df45cc8

File tree

6 files changed

+378
-79
lines changed

6 files changed

+378
-79
lines changed

redis/_parsers/commands.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
class RequestPolicy(Enum):
1212
ALL_NODES = 'all_nodes'
1313
ALL_SHARDS = 'all_shards'
14+
ALL_REPLICAS = 'all_replicas'
1415
MULTI_SHARD = 'multi_shard'
1516
SPECIAL = 'special'
1617
DEFAULT_KEYLESS = 'default_keyless'
1718
DEFAULT_KEYED = 'default_keyed'
19+
DEFAULT_NODE = 'default_node'
1820

1921
class ResponsePolicy(Enum):
2022
ONE_SUCCEEDED = 'one_succeeded'
@@ -162,7 +164,9 @@ def get_keys(self, redis_conn, *args):
162164
for subcmd in command["subcommands"]:
163165
if str_if_bytes(subcmd[0]) == subcmd_name:
164166
command = self.parse_subcommand(subcmd)
165-
is_subcmd = True
167+
168+
if command['first_key_pos'] > 0:
169+
is_subcmd = True
166170

167171
# The command doesn't have keys in it
168172
if not is_subcmd:

0 commit comments

Comments
 (0)