beobal commented on code in PR #4613:
URL: https://github.com/apache/cassandra/pull/4613#discussion_r2873311643
##########
src/java/org/apache/cassandra/tcm/ClusterMetadata.java:
##########
@@ -202,40 +215,164 @@ private ClusterMetadata(int metadataIdentifier,
this.schema = schema;
this.directory = directory;
this.tokenMap = tokenMap;
- this.placements = placements;
this.accordFastPath = accordFastPath;
+ this.placements = placements;
this.lockedRanges = lockedRanges;
this.inProgressSequences = inProgressSequences;
this.consensusMigrationState = consensusMigrationState;
this.extensions = ImmutableMap.copyOf(extensions);
this.locator = Locator.usingDirectory(directory);
this.accordStaleReplicas = accordStaleReplicas;
+ this.cmsMembership = cmsMembership;
+ // Build CMS placement using no-op CMS lookup, i.e. using only
committed node addresses
+ this.cmsDataPlacement = calculateCMSPlacement(placements,
cmsMembership, CMSLookup.NO_OP);
}
- public Set<InetAddressAndPort> fullCMSMembers()
+ public Set<NodeId> fullCMSMemberIds()
{
- if (fullCMSEndpoints == null)
- this.fullCMSEndpoints =
ImmutableSet.copyOf(placements.get(ReplicationParams.meta(this)).reads.byEndpoint().keySet());
- return fullCMSEndpoints;
+ return cmsMembership.fullMembers();
}
- public Set<NodeId> fullCMSMemberIds()
+ public boolean isCMSMember(InetAddressAndPort endpoint)
Review Comment:
I've done the former and also memoized the local node id in the
`ClusterMetadata` constructor. This replaces the possibility of returning a
`null` when the node is not yet registered with a new constant
`NodeId.UNREGISTERED` (maybe that should be `NONREGISTERED`?).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]