Ejemplo 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());
        }
Ejemplo 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.");
        }
Ejemplo 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();
        }