mirror of
https://github.com/fluencelabs/redis
synced 2025-03-25 03:41:04 +00:00
redis-trib: load info about importing/migrating slots from node.
This commit is contained in:
parent
a8b09faf3d
commit
1a6df1049d
@ -43,6 +43,8 @@ class ClusterNode
|
|||||||
@info[:host] = s[0]
|
@info[:host] = s[0]
|
||||||
@info[:port] = s[1]
|
@info[:port] = s[1]
|
||||||
@info[:slots] = {}
|
@info[:slots] = {}
|
||||||
|
@info[:migrating] = {}
|
||||||
|
@info[:importing] = {}
|
||||||
@dirty = false # True if we need to flush slots info into node.
|
@dirty = false # True if we need to flush slots info into node.
|
||||||
@friends = []
|
@friends = []
|
||||||
end
|
end
|
||||||
@ -112,7 +114,13 @@ class ClusterNode
|
|||||||
@info[:slots] = {}
|
@info[:slots] = {}
|
||||||
slots.each{|s|
|
slots.each{|s|
|
||||||
if s[0..0] == '['
|
if s[0..0] == '['
|
||||||
# Fixme: for now skipping migration entries
|
if s[2..4] == "->-" # Migrating
|
||||||
|
slot,dst = s[1..-1].split("->-")
|
||||||
|
@info[:migrating][slot] = dst
|
||||||
|
elsif s[2..4] == "-<-" # Importing
|
||||||
|
slot,src = s[1..-1].split("-<-")
|
||||||
|
@info[:importing][slot] = src
|
||||||
|
end
|
||||||
elsif s.index("-")
|
elsif s.index("-")
|
||||||
start,stop = s.split("-")
|
start,stop = s.split("-")
|
||||||
self.add_slots((start.to_i)..(stop.to_i))
|
self.add_slots((start.to_i)..(stop.to_i))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user