public static ISiloPersistentStreamConfigurator UseDynamicClusterConfigDeploymentBalancer(this ISiloPersistentStreamConfigurator configurator,
                                                                                           TimeSpan?siloMaturityPeriod = null)
 {
     return(configurator.ConfigurePartitionBalancing <DeploymentBasedQueueBalancerOptions>(
                (s, n) => DeploymentBasedQueueBalancer.Create(s, n, s.GetService <IOptions <StaticClusterDeploymentOptions> >().Value),
                options => options.Configure(op =>
     {
         op.IsFixed = false;
         if (siloMaturityPeriod.HasValue)
         {
             op.SiloMaturityPeriod = siloMaturityPeriod.Value;
         }
     })));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Stream queue balancer that uses Azure deployment information for load balancing.
 /// Requires silo running in Azure.
 /// This Balancer uses both the information about the full set of silos as reported by Azure role code but
 /// does NOT use the information from Membership oracle about currently alive silos.
 /// That is, it does not rebalance queues based on dynamic changes in the cluster Membership.
 /// </summary>
 public static ISiloPersistentStreamConfigurator UseStaticAzureDeploymentBalancer(this ISiloPersistentStreamConfigurator configurator,
                                                                                  TimeSpan?siloMaturityPeriod = null)
 {
     return(configurator.ConfigurePartitionBalancing <DeploymentBasedQueueBalancerOptions>(
                (s, n) => DeploymentBasedQueueBalancer.Create(s, n, new ServiceRuntimeWrapper(s.GetService <ILoggerFactory>())),
                options => options.Configure(op =>
     {
         op.IsFixed = true;
         if (siloMaturityPeriod.HasValue)
         {
             op.SiloMaturityPeriod = siloMaturityPeriod.Value;
         }
     })));
 }
 public static TConfigurator UseStaticClusterConfigDeploymentBalancer <TConfigurator>(this TConfigurator configurator,
                                                                                      TimeSpan?siloMaturityPeriod = null)
     where TConfigurator : NamedServiceConfigurator, ISiloPersistentStreamConfigurator
 {
     return(configurator.ConfigurePartitionBalancing <TConfigurator, DeploymentBasedQueueBalancerOptions>(
                (s, n) => DeploymentBasedQueueBalancer.Create(s, n, s.GetService <IOptions <StaticClusterDeploymentOptions> >().Value),
                options => options.Configure(op =>
     {
         op.IsFixed = true;
         if (siloMaturityPeriod.HasValue)
         {
             op.SiloMaturityPeriod = siloMaturityPeriod.Value;
         }
     })));
 }