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
f066e526
Commit
f066e526
authored
Jan 24, 2019
by
artix
Committed by
antirez
Jan 25, 2019
Browse files
Cluster Manager: remove unused code elements
parent
23214966
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
f066e526
...
@@ -1893,7 +1893,6 @@ typedef struct clusterManagerNode {
...
@@ -1893,7 +1893,6 @@ typedef struct clusterManagerNode {
int
flags
;
int
flags
;
list
*
flags_str
;
/* Flags string representations */
list
*
flags_str
;
/* Flags string representations */
sds
replicate
;
/* Master ID if node is a slave */
sds
replicate
;
/* Master ID if node is a slave */
list replicas;
int
dirty
;
/* Node has changes that can be flushed */
int
dirty
;
/* Node has changes that can be flushed */
uint8_t
slots
[
CLUSTER_MANAGER_SLOTS
];
uint8_t
slots
[
CLUSTER_MANAGER_SLOTS
];
int
slots_count
;
int
slots_count
;
...
@@ -2424,21 +2423,17 @@ static int clusterManagerGetAntiAffinityScore(clusterManagerNodeArray *ipnodes,
...
@@ -2424,21 +2423,17 @@ static int clusterManagerGetAntiAffinityScore(clusterManagerNodeArray *ipnodes,
clusterManagerNode
*
node
=
node_array
->
nodes
[
j
];
clusterManagerNode
*
node
=
node_array
->
nodes
[
j
];
if
(
node
==
NULL
)
continue
;
if
(
node
==
NULL
)
continue
;
if
(
!
ip
)
ip
=
node
->
ip
;
if
(
!
ip
)
ip
=
node
->
ip
;
sds types
, otypes
;
sds
types
;
/
/
We always use the Master ID as key
/
*
We always use the Master ID as key
. */
sds
key
=
(
!
node
->
replicate
?
node
->
name
:
node
->
replicate
);
sds
key
=
(
!
node
->
replicate
?
node
->
name
:
node
->
replicate
);
assert
(
key
!=
NULL
);
assert
(
key
!=
NULL
);
dictEntry
*
entry
=
dictFind
(
related
,
key
);
dictEntry
*
entry
=
dictFind
(
related
,
key
);
if (entry) otypes = (sds) dictGetVal(entry);
if
(
entry
)
types
=
sdsdup
((
sds
)
dictGetVal
(
entry
));
else {
else
types
=
sdsempty
();
otypes = sdsempty();
/* Master type 'm' is always set as the first character of the
dictAdd(related, key, otypes);
* types string. */
}
if
(
!
node
->
replicate
)
types
=
sdscatprintf
(
types
,
"m%s"
,
types
);
// Master type 'm' is always set as the first character of the
else
types
=
sdscat
(
types
,
"s"
);
// types string.
otypes = sdsdup(otypes);
if (!node->replicate) types = sdscatprintf(otypes, "m%s", otypes);
else types = sdscat(otypes, "s");
dictReplace
(
related
,
key
,
types
);
dictReplace
(
related
,
key
,
types
);
}
}
/* Now it's trivial to check, for each related group having the
/* Now it's trivial to check, for each related group having the
...
...
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