frankgh commented on code in PR #211:
URL: https://github.com/apache/cassandra-sidecar/pull/211#discussion_r2004420972


##########
server/src/main/java/org/apache/cassandra/sidecar/modules/CoordinationModule.java:
##########
@@ -70,6 +72,18 @@ ElectorateMembership 
electorateMembership(InstanceMetadataFetcher instanceMetada
                                               CQLSessionProvider 
cqlSessionProvider,
                                               SidecarConfiguration 
configuration)
     {
-        return new 
MostReplicatedKeyspaceTokenZeroElectorateMembership(instanceMetadataFetcher, 
cqlSessionProvider, configuration);
+        String strategy = configuration.serviceConfiguration()
+                                       .coordinationConfiguration()
+                                       .clusterLeaseClaimConfiguration()
+                                       .electorateMembershipStrategy();
+        switch (strategy)
+        {
+            case "MostReplicatedKeyspaceTokenZeroElectorateMembership":
+                return new 
MostReplicatedKeyspaceTokenZeroElectorateMembership(instanceMetadataFetcher, 
cqlSessionProvider, configuration);
+            case "SidecarInternalTokenZeroElectorateMembership":
+                return new 
SidecarInternalTokenZeroElectorateMembership(instanceMetadataFetcher, 
configuration);
+            default:
+                throw new ConfigurationException("Invalid electorate 
membership strategy value '" + strategy + "'");
+        }

Review Comment:
   done



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to