Esempio n. 1
0
        // Below is an example of how to programmatically configure a new storage provider that is not already specified in the XML config file.
        private void Example_ConfigureNewStorageProvider(ClusterConfiguration config)
        {
            config.AddAzureTableStorageProvider("MyNewAzureStoreProvider");

            // Once silo starts you can see that it prints in the log:
            //  Providers:
            //      StorageProviders:
            //          Name=MyNewAzureStoreProvider, Type=Orleans.Storage.AzureTableStorage, Properties=[DataConnectionString, TableName, DeleteStateOnClear, UseJsonFormat]
        }
Esempio n. 2
0
        private static void AdjustConfig(ClusterConfiguration config)
        {
            // register stream provider
            config.Globals.RegisterStreamProvider <EventHubStreamProvider>(StreamProviderName, BuildProviderSettings());
            config.AddAzureTableStorageProvider(ImplicitSubscription_RecoverableStream_CollectorGrain.StorageProviderName);

            // Make sure a node config exist for each silo in the cluster.
            // This is required for the DynamicClusterConfigDeploymentBalancer to properly balance queues.
            // GetConfigurationForNode will materialize a node in the configuration for each silo, if one does not already exist.
            config.GetOrCreateNodeConfigurationForSilo("Primary");
            config.GetOrCreateNodeConfigurationForSilo("Secondary_1");
        }
Esempio n. 3
0
        private static int StartSilo(string[] args)
        {
            // define the cluster configuration
            var config = new ClusterConfiguration();

            config.Globals.LivenessType         = GlobalConfiguration.LivenessProviderType.AzureTable;
            config.Globals.ReminderServiceType  = GlobalConfiguration.ReminderServiceProviderType.AzureTable;
            config.Globals.DataConnectionString = "MY_DATA_CONNECTION_STRING";
            config.AddMemoryStorageProvider();
            config.AddAzureTableStorageProvider("AzureStore");
            config.Defaults.DefaultTraceLevel = Severity.Error;
            config.Defaults.Port = 100;
            config.Defaults.ProxyGatewayEndpoint = new IPEndPoint(config.Defaults.Endpoint.Address, 101);

            hostWrapper = new OrleansHostWrapper(config, args);
            return(hostWrapper.Run());
        }
        static void AddStorageProviders(ClusterConfiguration clusterConfig, ConfigurationPackage appConfig)
        {
            var storageSettings = appConfig.Settings.Sections["Storage"].Parameters;

            clusterConfig.Globals.DataConnectionString = storageSettings["SiloStorageConnectionString"].Value;

            clusterConfig.Globals.ReminderServiceType = GlobalConfiguration.ReminderServiceProviderType.AzureTable;
            clusterConfig.Globals.DataConnectionStringForReminders = storageSettings["RemindersStorageConnectionString"].Value;

            var useJson    = bool.Parse(storageSettings["GrainsUseJsonFormat"].Value);
            var indentJson = useJson && bool.Parse(storageSettings["GrainsUseIndentedJsonFormat"].Value);

            clusterConfig.AddAzureTableStorageProvider(
                providerName: "Default",
                connectionString: storageSettings["GrainStorageConnectionString"].Value,
                useJsonFormat: useJson,
                indentJson: indentJson);
        }
Esempio n. 5
0
        private static ClusterConfiguration BuildAzureClusterConfig()
        {
            var assemblyName = typeof(AzureTableStorage).AssemblyQualifiedName;

            Console.WriteLine("Using assembly path" + assemblyName);

            string StorageConnectionString = "DefaultEndpointsProtocol=https;AccountName=prowemarket;AccountKey=4JOmgr/4XmolsEXzQJCrTlgpTqT/GCmwFB78y04sFOw57on+k3V6P36qECUVD86aV6FVBYmrRLvesmydP6jDaw==;";
            var    config = new ClusterConfiguration();

            config.Globals.LivenessType            = GlobalConfiguration.LivenessProviderType.AzureTable;
            config.Globals.ReminderServiceType     = GlobalConfiguration.ReminderServiceProviderType.AzureTable;
            config.Globals.MembershipTableAssembly = assemblyName;
            config.Globals.DeploymentId            = "dev";
            config.Globals.DataConnectionString    = StorageConnectionString;
            config.Defaults.Port = 40000;
            config.Defaults.ProxyGatewayEndpoint = new IPEndPoint(IPAddress.Any, 40001);
            config.Defaults.TraceFileName        = null;
            config.Defaults.TraceFilePattern     = null;
            config.AddAzureTableStorageProvider(
                providerName: "Default",
                connectionString: StorageConnectionString
                );
            return(config);
        }
 private static void AdjustConfig(ClusterConfiguration config)
 {
     // register stream provider
     config.Globals.RegisterStreamProvider <EventHubStreamProvider>(StreamProviderName, BuildProviderSettings());
     config.AddAzureTableStorageProvider(ImplicitSubscription_RecoverableStream_CollectorGrain.StorageProviderName);
 }