Esempio n. 1
0
        public async Task DefaultPlacementShouldBeRandom()
        {
            await this.HostedCluster.WaitForLivenessToStabilizeAsync();

            logger.Info("********************** Starting the test DefaultPlacementShouldBeRandom ******************************");
            TestSilosStarted(2);

            Assert.Equal(
                RandomPlacement.Singleton,
                PlacementStrategy.GetDefault());
        }
Esempio n. 2
0
        public async Task DefaultPlacementShouldBeRandom()
        {
            await WaitForLivenessToStabilizeAsync();

            logger.Info("********************** Starting the test DefaultPlacementShouldBeRandom ******************************");
            TestSilosStarted(2);

            Assert.AreEqual(
                RandomPlacement.Singleton,
                PlacementStrategy.GetDefault(),
                "The default placement strategy is expected to be random.");
        }
Esempio n. 3
0
        public static void CreatePlacementDirectorsManager(GlobalConfiguration globalConfig)
        {
            Instance = new PlacementDirectorsManager();
            Instance.Register <RandomPlacement, RandomPlacementDirector>();
            Instance.Register <PreferLocalPlacement, PreferLocalPlacementDirector>();
            Instance.Register <StatelessWorkerPlacement, StatelessWorkerDirector>();
            Instance.Register <ActivationCountBasedPlacement, ActivationCountPlacementDirector>();

            var acDirector = (ActivationCountPlacementDirector)Instance.directors[typeof(ActivationCountBasedPlacement)];

            acDirector.Initialize(globalConfig);

            defaultPlacementStrategy = PlacementStrategy.GetDefault();
        }