예제 #1
0
        public override void Run()
        {
            var config = new ClusterConfiguration();

            config.StandardLoad();

            // Configure storage providers

            silo = new AzureSilo();
            bool ok = silo.Start(RoleEnvironment.DeploymentId,
                                 RoleEnvironment.CurrentRoleInstance,
                                 config);

            silo.Run(); // Call will block until silo is shutdown

            Trace.TraceInformation("OrleansAzureSilos is running");

            try
            {
                this.RunAsync(this.cancellationTokenSource.Token).Wait();
            }
            finally
            {
                this.runCompleteEvent.Set();
            }
        }
예제 #2
0
        public override void Run()
        {
            var config = new ClusterConfiguration();
            config.StandardLoad();

            // Configure storage providers

            silo = new AzureSilo();
            bool ok = silo.Start(RoleEnvironment.DeploymentId,
                                 RoleEnvironment.CurrentRoleInstance,
                                 config);

            silo.Run(); // Call will block until silo is shutdown

            Trace.TraceInformation("OrleansAzureSilos is running");

            try
            {
                this.RunAsync(this.cancellationTokenSource.Token).Wait();
            }
            finally
            {
                this.runCompleteEvent.Set();
            }
        }
        public override void Dispose()
        {
            if (host == null)
                return;

            host.Stop();
            host = null;

            cluster.Dispose();
        }
        internal AzureClusterActorSystem(ClusterConfigurator cluster, string deploymentId, string connectionString)
        {
            ClusterActorSystem.Current = this;

            this.cluster = cluster;
            this.deploymentId = deploymentId;
            this.connectionString = connectionString;

            host = new AzureSilo();
        }
예제 #5
0
        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections
            ServicePointManager.DefaultConnectionLimit = 12;

            this.cloudSilo = new AzureSilo();
            var success = this.cloudSilo.Start();

            return success;
        }
예제 #6
0
 public override void Run() { 
     var config = new ClusterConfiguration();
     config.StandardLoad();
     
     // It is IMPORTANT to start the silo not in OnStart but in Run. 
     // Azure may not have the firewalls open yet (on the remote silos) at the OnStart phase.
     silo = new AzureSilo();
     bool isSiloStarted = silo.Start(config);
     
     silo.Run(); // Call will block until silo is shutdown
 } 
예제 #7
0
파일: WebRole.cs 프로젝트: stanroze/orleans
        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections 
            ServicePointManager.DefaultConnectionLimit = 12;

            Trace.WriteLine("Starting Role Entry Point");

            silo = new AzureSilo();

            return silo.Start(RoleEnvironment.DeploymentId, RoleEnvironment.CurrentRoleInstance);
        }
예제 #8
0
        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections 
            ServicePointManager.DefaultConnectionLimit = 12;

            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.

            silo = new AzureSilo();

            return silo.Start(); 
        }
예제 #9
0
        public async void ValidateConfiguration_IncorrectKey()
        {
            var serviceRuntime = new TestServiceRuntimeWrapper();
            serviceRuntime.DeploymentId = "bar";
            serviceRuntime.Settings["DataConnectionString"] = "DefaultEndpointsProtocol=https;AccountName=orleanstest;AccountKey=IncorrectKey";
            serviceRuntime.InstanceName = "name";

            var config = AzureSilo.DefaultConfiguration(serviceRuntime);
            config.AddMemoryStorageProvider();

            AzureSilo orleansAzureSilo = new AzureSilo(serviceRuntime);
            bool ok = await orleansAzureSilo.ValidateConfiguration(config);

            Assert.False(ok);
        }
예제 #10
0
        public async void ValidateConfiguration_InvalidConnectionString()
        {
            var serviceRuntime = new TestServiceRuntimeWrapper();
            serviceRuntime.DeploymentId = "bar";
            serviceRuntime.Settings["DataConnectionString"] = "InvalidConnectionString";
            serviceRuntime.InstanceName = "name";

            var config = AzureSilo.DefaultConfiguration(serviceRuntime);
            config.AddMemoryStorageProvider();

            AzureSilo orleansAzureSilo = new AzureSilo(serviceRuntime);
            bool ok = await orleansAzureSilo.ValidateConfiguration(config);

            Assert.False(ok);
        }
예제 #11
0
        public async void ValidateConfiguration_Startup()
        {
            Skip.IfNot(StorageEmulator.TryStart(), "This test explicitly requires the Azure Storage emulator to run");

            var serviceRuntime = new TestServiceRuntimeWrapper();
            serviceRuntime.DeploymentId = "foo";
            serviceRuntime.Settings["DataConnectionString"] = "UseDevelopmentStorage=true";
            serviceRuntime.InstanceName = "name";

            var config = AzureSilo.DefaultConfiguration(serviceRuntime);
            config.AddMemoryStorageProvider();

            AzureSilo orleansAzureSilo = new AzureSilo(serviceRuntime);
            bool ok = await orleansAzureSilo.ValidateConfiguration(config);

            Assert.True(ok);
        }
예제 #12
0
        public override void Run()
        {
            Trace.TraceInformation("OrleansDemo.Worker is running");

            try
            {
                _silo = new AzureSilo();

                _silo.Start();

                _silo.Run();
            }
            finally
            {
                this.runCompleteEvent.Set();
            }
        }
예제 #13
0
        /// <summary>
        /// The on start.
        /// </summary>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public override bool OnStart()
        {
            // Note that you need to do this :)
            // Note that you need to do this :)
            // Note that you need to do this :)
            // Also check out AzureTableJournalProvider, for actual use.
            JournalProviderManager.Manager.GetProviderDelegate =
                (_, __) => new AzureTableJournalProvider("UseDevelopmentStorage=true", JsonSerializationSettings.JsonConfig);

            this.silo = new AzureSilo();

            var ok = base.OnStart();
            if (ok)
            {
                ok = this.silo.Start();
            }

            return ok;
        }
예제 #14
0
        public override void Run()
        {
            Trace.WriteLine("OrleansAzureSilos-Run entry point called", "Information");

            Trace.WriteLine("OrleansAzureSilos-OnStart Starting Orleans silo", "Information");

            var config = AzureSilo.DefaultConfiguration();
            config.AddMemoryStorageProvider();
            
            // First example of how to configure an existing provider
            Example_ConfigureExistingStorageProvider(config);
            Example_ConfigureNewStorageProvider(config);
            Example_ConfigureNewBootstrapProvider(config);

            // It is IMPORTANT to start the silo not in OnStart but in Run.
            // Azure may not have the firewalls open yet (on the remote silos) at the OnStart phase.
            orleansAzureSilo = new AzureSilo();
            bool ok = orleansAzureSilo.Start(config);

            Trace.WriteLine("OrleansAzureSilos-OnStart Orleans silo started ok=" + ok, "Information");

            orleansAzureSilo.Run(); // Call will block until silo is shutdown
        }
예제 #15
0
 internal AzureClusterActorSystem(ClusterConfigurator cluster)
 {
     ClusterActorSystem.Current = this;
     this.cluster = cluster;
     host = new AzureSilo();
 }