コード例 #1
0
ファイル: MapReduceBenchmark.cs プロジェクト: ticup/orleans
 public void BenchmarkSetup()
 {
     TestClusterOptions.DefaultTraceToConsole = false;
     var options = new TestClusterOptions(1);
     options.ClusterConfiguration.ApplyToAllNodes(c => c.DefaultTraceLevel = Severity.Warning);
     _host = new TestCluster(options);
     _host.Deploy();
 }
コード例 #2
0
ファイル: StreamTestUtils.cs プロジェクト: jdom/orleans
 internal static void LogStartTest(string testName, Guid streamId, string streamProviderName, Logger logger, TestCluster siloHost)
 {
     SiloAddress primSilo = siloHost.Primary.SiloAddress;
     SiloAddress secSilo = siloHost.SecondarySilos.First()?.SiloAddress;
     logger.Info("\n\n**START********************** {0} ********************************* \n\n"
                 + "Running with initial silos Primary={1} Secondary={2} StreamId={3} StreamType={4} \n\n",
         testName, primSilo, secSilo, streamId, streamProviderName);
 }
コード例 #3
0
 private void Initialize(TestClusterOptions options = null)
 {
     if (options == null)
     {
         options = new TestClusterOptions(1);
     }
     testCluster = new TestCluster(options);
     testCluster.Deploy();
 }
 protected void Initialize()
 {
     GrainClient.Uninitialize();
     var testCluster = CreateTestCluster();
     if (testCluster.Primary == null)
     {
         testCluster.Deploy();
     }
     this.HostedCluster = testCluster;
 }
コード例 #5
0
 public TestClusterPerTest()
 {
     GrainClient.Uninitialize();
     var testCluster = this.CreateTestCluster();
     if (testCluster.Primary == null)
     {
         testCluster.Deploy();
     }
     this.HostedCluster = testCluster;
 }
コード例 #6
0
 private void SetupAndDeployCluster(string defaultPlacementStrategy, params Type[] blackListedTypes)
 {
     cluster?.StopAllSilos();
     var typesName = blackListedTypes.Select(t => t.FullName).ToList();
     var options = new TestClusterOptions(1);
     options.ClusterConfiguration.Globals.TypeMapRefreshInterval = refreshInterval;
     options.ClusterConfiguration.Globals.DefaultPlacementStrategy = defaultPlacementStrategy;
     options.ClusterConfiguration.Overrides[Silo.PrimarySiloName].ExcludedGrainTypes = typesName;
     cluster = new TestCluster(options);
     cluster.Deploy();
 }
コード例 #7
0
 private void Initialize(TimeSpan collectionAgeLimit, TimeSpan quantum)
 {
     GlobalConfiguration.ENFORCE_MINIMUM_REQUIREMENT_FOR_AGE_LIMIT = false;
     var options = new TestClusterOptions(1);
     var config = options.ClusterConfiguration;
     config.Globals.CollectionQuantum = quantum;
     config.Globals.Application.SetDefaultCollectionAgeLimit(collectionAgeLimit);
     config.Globals.Application.SetCollectionAgeLimit(typeof(IdleActivationGcTestGrain2), TimeSpan.FromSeconds(10));
     config.Globals.Application.SetCollectionAgeLimit(typeof(BusyActivationGcTestGrain2), TimeSpan.FromSeconds(10));
     testCluster = new TestCluster(config);
     testCluster.Deploy();
 }
コード例 #8
0
        public override TestCluster CreateTestCluster()
        {
            // Define a cluster of 4, but deploy ony 2 to start.
            var options = new TestClusterOptions(4);

            options.ClusterConfiguration.AddMemoryStorageProvider("PubSubStore");
            var persistentStreamProviderConfig = new PersistentStreamProviderConfig
            {
                SiloMaturityPeriod = SILO_IMMATURE_PERIOD,
                BalancerType = StreamQueueBalancerType.DynamicClusterConfigDeploymentBalancer,
            };

            options.ClusterConfiguration.AddAzureQueueStreamProvider(adapterName, persistentStreamProviderConfig: persistentStreamProviderConfig);
            options.ClientConfiguration.Gateways = options.ClientConfiguration.Gateways.Take(1).ToList();
            var host = new TestCluster(options);
            host.Deploy(new[] { Silo.PrimarySiloName, "Secondary_1" });
            return host;
        }
コード例 #9
0
ファイル: TestCluster.cs プロジェクト: MikeHardman/orleans
        public static SiloHandle StartOrleansSilo(TestCluster cluster, Silo.SiloType type, ClusterConfiguration clusterConfig, NodeConfiguration nodeConfig)
        {
            if (cluster == null) throw new ArgumentNullException(nameof(cluster));
            var siloName = nodeConfig.SiloName;

            cluster.WriteLog("Starting a new silo in app domain {0} with config {1}", siloName, clusterConfig.ToString(siloName));
            AppDomain appDomain;
            Silo silo = cluster.LoadSiloInNewAppDomain(siloName, type, clusterConfig, out appDomain);

            silo.Start();

            SiloHandle retValue = new SiloHandle
            {
                Name = siloName,
                Silo = silo,
                NodeConfiguration = nodeConfig,
                Endpoint = silo.SiloAddress.Endpoint,
                AppDomain = appDomain,
            };
            cluster.ImportGeneratedAssemblies(retValue);
            return retValue;
        }
コード例 #10
0
 public void Dispose()
 {
     cluster?.StopAllSilos();
     cluster = null;
 }
コード例 #11
0
 public void Dispose()
 {
     testCluster?.StopAllSilos();
     testCluster = null;
 }
コード例 #12
0
 public HostedTestClusterEnsureDefaultStarted(DefaultClusterFixture fixture)
 {
     this.HostedCluster = fixture.HostedCluster;
 }
コード例 #13
0
ファイル: TestCluster.cs プロジェクト: osjimenez/orleans
        /// <summary>
        /// Start a new silo in the target cluster
        /// </summary>
        /// <param name="cluster">The TestCluster in which the silo should be deployed</param>
        /// <param name="type">The type of the silo to deploy</param>
        /// <param name="clusterConfig">The cluster config to use</param>
        /// <param name="nodeConfig">The configuration for the silo to deploy</param>
        /// <returns>A handle to the silo deployed</returns>
        public static SiloHandle StartOrleansSilo(TestCluster cluster, Silo.SiloType type, ClusterConfiguration clusterConfig, NodeConfiguration nodeConfig)
        {
            if (cluster == null) throw new ArgumentNullException(nameof(cluster));
            var siloName = nodeConfig.SiloName;

            cluster.WriteLog("Starting a new silo in app domain {0} with config {1}", siloName, clusterConfig.ToString(siloName));
            var handle = cluster.LoadSiloInNewAppDomain(siloName, type, clusterConfig, nodeConfig);
            return handle;
        }
コード例 #14
0
 public void Dispose()
 {
     GlobalConfiguration.ENFORCE_MINIMUM_REQUIREMENT_FOR_AGE_LIMIT = true;
     testCluster?.StopAllSilos();
     testCluster = null;
 }
コード例 #15
0
 public ClientStreamTestRunner(TestCluster testHost)
 {
     this.testHost = testHost;
 }