Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1a6df104
Commit
1a6df104
authored
Mar 21, 2013
by
antirez
Browse files
redis-trib: load info about importing/migrating slots from node.
parent
a8b09faf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
1a6df104
...
...
@@ -43,6 +43,8 @@ class ClusterNode
@info
[
:host
]
=
s
[
0
]
@info
[
:port
]
=
s
[
1
]
@info
[
:slots
]
=
{}
@info
[
:migrating
]
=
{}
@info
[
:importing
]
=
{}
@dirty
=
false
# True if we need to flush slots info into node.
@friends
=
[]
end
...
...
@@ -112,7 +114,13 @@ class ClusterNode
@info
[
:slots
]
=
{}
slots
.
each
{
|
s
|
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
(
"-"
)
start
,
stop
=
s
.
split
(
"-"
)
self
.
add_slots
((
start
.
to_i
)
..
(
stop
.
to_i
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment