Beispiel #1
0
        private static bool IsReplicaEligible(ReplicaWrapper replica, StatefulReplicaSelectionMode statefulReplicaSelectionMode)
        {
            if (replica.ServiceKind != ServiceKind.Stateful)
            {
                // Stateless service replicas are always eligible
                return(true);
            }

            return(statefulReplicaSelectionMode switch
            {
                StatefulReplicaSelectionMode.Primary => replica.Role == ReplicaRole.Primary,
                StatefulReplicaSelectionMode.ActiveSecondary => replica.Role == ReplicaRole.ActiveSecondary,
                _ => true,
            });
Beispiel #2
0
 public static void IneligibleEndpointSkipped(ILogger <Discoverer> logger, long replicaId, Uri serviceName, StatefulReplicaSelectionMode statefulReplicaSelectionMode)
 {
     _ineligibleEndpointSkipped(logger, replicaId, serviceName, statefulReplicaSelectionMode, null);
 }