Example #1
0
 /// <summary>
 /// Create a <see cref="PlacementService"/> instance.
 /// </summary>
 public PlacementService(
     IOptionsMonitor <SiloMessagingOptions> siloMessagingOptions,
     ILocalSiloDetails localSiloDetails,
     ISiloStatusOracle siloStatusOracle,
     ILogger <PlacementService> logger,
     GrainLocator grainLocator,
     GrainVersionManifest grainInterfaceVersions,
     CachedVersionSelectorManager versionSelectorManager,
     PlacementDirectorResolver directorResolver,
     PlacementStrategyResolver strategyResolver)
 {
     LocalSilo                         = localSiloDetails.SiloAddress;
     _strategyResolver                 = strategyResolver;
     _directorResolver                 = directorResolver;
     _logger                           = logger;
     _grainLocator                     = grainLocator;
     _grainInterfaceVersions           = grainInterfaceVersions;
     _versionSelectorManager           = versionSelectorManager;
     _siloStatusOracle                 = siloStatusOracle;
     _assumeHomogeneousSilosForTesting = siloMessagingOptions.CurrentValue.AssumeHomogenousSilosForTesting;
     _workers                          = new PlacementWorker[PlacementWorkerCount];
     for (var i = 0; i < PlacementWorkerCount; i++)
     {
         _workers[i] = new(this);
     }
 }
Example #2
0
 /// <summary>
 /// Create a <see cref="PlacementService"/> instance.
 /// </summary>
 public PlacementService(PlacementDirectorResolver directorResolver, PlacementStrategyResolver strategyResolver)
 {
     _strategyResolver = strategyResolver;
     _directorResolver = directorResolver;
 }