redis-cluster-client 0.17.1 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 359726530c2640f2ceb9c6c06322c4608fec64338c33d3b29f675b1e152c6700
|
|
4
|
+
data.tar.gz: ec32116a8cde689a6ea78cc029159174404288c63b452d797ff3646669b5141e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f4b810aa80374e5720533c82846ac0485682c6b8bcd5902c6a71a9b4d2c830914a3d97cfb8c378a402b3cd44cd5a96361067d461f177d8672b918a3b6911a38d
|
|
7
|
+
data.tar.gz: 4614bba3d265eeedf3ebe72fa75ab10ca2543a48aa0e622b530fa54ad1701af158a77819e4d0cd6aa7ce1f913df139169497caf084186eb6875a49e312b84d94
|
|
@@ -33,6 +33,7 @@ class RedisClient
|
|
|
33
33
|
'keys' => RoutingAction.new(method_name: :send_command_to_replicas, reply_transformer: FLATTEN_STRINGS),
|
|
34
34
|
'dbsize' => RoutingAction.new(method_name: :send_command_to_replicas, reply_transformer: SUM_NUM),
|
|
35
35
|
'scan' => RoutingAction.new(method_name: :send_scan_command),
|
|
36
|
+
'bless' => RoutingAction.new(method_name: :send_bless_command),
|
|
36
37
|
'lastsave' => RoutingAction.new(method_name: :send_command_to_all_nodes, reply_transformer: SORT_NUMBERS),
|
|
37
38
|
'role' => RoutingAction.new(method_name: :send_command_to_all_nodes),
|
|
38
39
|
'config' => RoutingAction.new(method_name: :send_config_command),
|
|
@@ -133,9 +133,9 @@ class RedisClient
|
|
|
133
133
|
retry
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
-
def scan(command, seed: nil) # rubocop:disable Metrics/AbcSize
|
|
137
|
-
command[
|
|
138
|
-
input_cursor = Integer(command[
|
|
136
|
+
def scan(command, seed: nil, cursor_index: 1) # rubocop:disable Metrics/AbcSize
|
|
137
|
+
command[cursor_index] = ZERO_CURSOR_FOR_SCAN if command.size == cursor_index
|
|
138
|
+
input_cursor = Integer(command[cursor_index])
|
|
139
139
|
|
|
140
140
|
client_index = input_cursor % 256
|
|
141
141
|
raw_cursor = input_cursor >> 8
|
|
@@ -145,7 +145,7 @@ class RedisClient
|
|
|
145
145
|
client = clients[client_index]
|
|
146
146
|
return [ZERO_CURSOR_FOR_SCAN, []] unless client
|
|
147
147
|
|
|
148
|
-
command[
|
|
148
|
+
command[cursor_index] = raw_cursor.to_s
|
|
149
149
|
|
|
150
150
|
result_cursor, result_keys = client.call_v(command)
|
|
151
151
|
result_cursor = Integer(result_cursor)
|
|
@@ -327,6 +327,14 @@ class RedisClient
|
|
|
327
327
|
end
|
|
328
328
|
end
|
|
329
329
|
|
|
330
|
+
def send_bless_command(method, command, args, &block)
|
|
331
|
+
if command[1].casecmp('scan').zero?
|
|
332
|
+
scan(command, seed: 1, cursor_index: 2).then(&TSF.call(block))
|
|
333
|
+
else
|
|
334
|
+
assign_node(command).public_send(method, *args, command, &block)
|
|
335
|
+
end
|
|
336
|
+
end
|
|
337
|
+
|
|
330
338
|
def send_memory_command(method, command, args, &block)
|
|
331
339
|
if command[1].casecmp('stats').zero?
|
|
332
340
|
@node.call_all(method, command, args, &block)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redis-cluster-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.17.
|
|
4
|
+
version: 0.17.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Taishi Kasuga
|
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
75
75
|
- !ruby/object:Gem::Version
|
|
76
76
|
version: '0'
|
|
77
77
|
requirements: []
|
|
78
|
-
rubygems_version: 4.0.
|
|
78
|
+
rubygems_version: 4.0.20
|
|
79
79
|
specification_version: 4
|
|
80
80
|
summary: Redis cluster-aware client for Ruby
|
|
81
81
|
test_files: []
|