You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/05/26 16:07:33 UTC
[GitHub] [geode] sabbey37 commented on a change in pull request #6521: GEODE-9314: Redis CLUSTER NODES incorrect when primary buckets are moving
sabbey37 commented on a change in pull request #6521:
URL: https://github.com/apache/geode/pull/6521#discussion_r639864669
##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/executor/cluster/ClusterExecutor.java
##########
@@ -129,6 +129,18 @@ private RedisResponse getNodes(ExecutionHandlerContext ctx) throws InterruptedEx
return RedisResponse.bulkString(response.toString());
}
+ private Map<String, List<Integer>> getMemberBuckets(
+ List<SlotAdvisor.MemberBucketSlot> bucketSlots) {
+ Map<String, List<Integer>> result = new HashMap<>();
Review comment:
Could we call this `memberBuckets`?
##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/SlotAdvisor.java
##########
@@ -133,13 +125,16 @@ private RedisMemberInfo getMemberInfo0(int bucketId) {
public static class MemberBucketSlot {
private final int bucketId;
+ private DistributedMember member;
Review comment:
This variable could be final.
##########
File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/executor/cluster/ClusterExecutor.java
##########
@@ -129,6 +129,18 @@ private RedisResponse getNodes(ExecutionHandlerContext ctx) throws InterruptedEx
return RedisResponse.bulkString(response.toString());
}
+ private Map<String, List<Integer>> getMemberBuckets(
+ List<SlotAdvisor.MemberBucketSlot> bucketSlots) {
+ Map<String, List<Integer>> result = new HashMap<>();
+
+ for (SlotAdvisor.MemberBucketSlot mbs : bucketSlots) {
+ result.computeIfAbsent(mbs.getMember().getUniqueId(), k -> new ArrayList<>())
+ .add(mbs.getBucketId());
+ }
Review comment:
Previously, we were creating members if they didn't exist for a particular bucketID... do we no longer need to do that?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org