Esempio n. 1
0
 public void Configure(ISiloBuilder hostBuilder)
 {
     hostBuilder.AddAzureBlobGrainStorage("AzureStore", (AzureBlobStorageOptions options) =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     });
 }
            public void Configure(ISiloBuilder hostBuilder)
            {
                hostBuilder
                .AddAzureBlobGrainStorage(
                    ImplicitSubscription_RecoverableStream_CollectorGrain.StorageProviderName,
                    (AzureBlobStorageOptions options) =>
                {
                    options.ConfigureBlobServiceClient(TestDefaultConfiguration.DataConnectionString);
                })
                .AddEventHubStreams(StreamProviderName, b =>
                {
                    b.UseDynamicClusterConfigDeploymentBalancer();
                    b.ConfigureStreamPubSub(StreamPubSubType.ImplicitOnly);
                    b.ConfigureEventHub(ob => ob.Configure(
                                            options =>
                    {
                        options.ConfigureTestDefaults(EHPath, EHConsumerGroup);
                    }));

                    b.UseAzureTableCheckpointer(ob => ob.Configure(options =>
                    {
                        options.ConfigureTableServiceClient(TestDefaultConfiguration.DataConnectionString);
                        options.PersistInterval = TimeSpan.FromSeconds(1);
                    }));
                });
            }
 public void Configure(ISiloBuilder hostBuilder)
 {
     hostBuilder.AddAzureBlobGrainStorage("AzureStore", (AzureBlobStorageOptions options) =>
     {
         options.ConfigureTestDefaults();
     });
 }
Esempio n. 4
0
        public static ISiloBuilder MorsteadGrainStorage(this ISiloBuilder builder, Action <MorsteadStorageConfiguration> configure, IConfiguration configuration)
        {
            var config = new MorsteadStorageConfiguration();

            configure(config);
            var connectionString = configuration["MorsteadStorage:ConnectionString"];

            if (connectionString is null)
            {
                builder.AddMemoryGrainStorage(config.Name);
                return(builder);
            }

            builder.AddAzureBlobGrainStorage(
                name: config.Name,
                configureOptions: options =>
            {
                //options.TableName = config.Name.ToLower().Replace("-", "");
                options.ContainerName = config.Name.ToLower();
                // Use JSON for serializing the state in storage
                //options.UseFullAssemblyNames = true;
                options.UseJson          = true;
                options.ConnectionString = configuration["MorsteadStorage:ConnectionString"];
            });
            return(builder);
        }
Esempio n. 5
0
 public void Configure(ISiloBuilder hostBuilder)
 {
     hostBuilder.AddAzureBlobGrainStorage("AzureStore", (AzureBlobStorageOptions options) =>
     {
         options.ConfigureTestDefaults();
     })
     .AddAzureBlobGrainStorage("AzureStore1", (AzureBlobStorageOptions options) =>
     {
         options.ConfigureTestDefaults();
     })
     .AddAzureBlobGrainStorage("AzureStore2", (AzureBlobStorageOptions options) =>
     {
         options.ConfigureTestDefaults();
     })
     .AddAzureBlobGrainStorage("AzureStore3", (AzureBlobStorageOptions options) =>
     {
         options.ConfigureTestDefaults();
     })
     .AddAzureBlobGrainStorage("GrainStorageForTest", (AzureBlobStorageOptions options) =>
     {
         options.ConfigureTestDefaults();
     })
     .AddMemoryGrainStorage("test1")
     .AddMemoryGrainStorage("MemoryStore");
 }
 public void Configure(ISiloBuilder hostBuilder)
 {
     hostBuilder
     .AddAzureBlobGrainStorage("GrainStorageForTest", (AzureBlobStorageOptions options) =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
         options.UseJson          = true;
     });
 }
Esempio n. 7
0
 public void Configure(ISiloBuilder hostBuilder)
 {
     hostBuilder
     .AddAzureBlobGrainStorage("GrainStorageForTest", (AzureBlobStorageOptions options) =>
     {
         options.ConfigureTestDefaults();
         options.UseJson = true;
     });
 }
Esempio n. 8
0
        public static void ConfigureSilo(this ISiloBuilder builder, IConfiguration configuration)
        {
            var config = new SiloOptions();

            configuration.Bind("SiloOptions", config);

            builder
            .Configure <ProcessExitHandlingOptions>(options => { options.FastKillOnProcessExit = false; })
            .UseLocalhostClustering()
            .Configure <ClusterOptions>(options =>
            {
                options.ClusterId = "cluster1";
                options.ServiceId = "service1";
            })
            //.UseAzureStorageClustering(options => options.ConnectionString = connectionString)
            .AddLogStorageBasedLogConsistencyProvider()
            //.ConfigureEndpoints(Dns.GetHostName(), siloPort, gatewayPort)
            .ConfigureApplicationParts(parts =>
                                       parts.AddApplicationPart(typeof(HelloGrain).Assembly).WithReferences())
            .ConfigureLogging(logging => logging.AddConsole())
            .ConfigureLogging(logging => logging.SetMinimumLevel(LogLevel.Warning));

            if (config.UseAzureStorage)
            {
                var connectionString = configuration.GetConnectionString("AzureStorage");
                builder.AddAzureBlobGrainStorage("StorageProvider", options =>
                {
                    options.UseJson          = true;
                    options.ConnectionString = connectionString;
                });
            }
            else
            {
                var connectionString = configuration.GetConnectionString("AdoStorage");
                builder.AddAdoNetGrainStorage("StorageProvider", options =>
                {
                    options.Invariant        = "System.Data.SqlClient";
                    options.ConnectionString = connectionString;
                    options.UseJsonFormat    = true;
                });
                //.Configure<EndpointOptions>(options => options.AdvertisedIPAddress = IPAddress.Loopback);
            }
        }
Esempio n. 9
0
 public void Configure(ISiloBuilder hostBuilder)
 {
     hostBuilder.ConfigureLogging(builder =>
     {
         builder.AddFilter("Orleans.Runtime.Catalog", LogLevel.Debug);
         builder.AddFilter("Orleans.Runtime.Dispatcher", LogLevel.Trace);
         builder.AddFilter("Orleans.Runtime.GrainDirectory.LocalGrainDirectory", LogLevel.Trace);
         builder.AddFilter("Orleans.Runtime.GrainDirectory.GlobalSingleInstanceRegistrar", LogLevel.Trace);
         builder.AddFilter("Orleans.Runtime.LogConsistency.ProtocolServices", LogLevel.Trace);
         builder.AddFilter("Orleans.Storage.MemoryStorageGrain", LogLevel.Debug);
     });
     hostBuilder.AddAzureTableGrainStorage("AzureStore", builder => builder.Configure <IOptions <ClusterOptions> >((options, silo) =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     }));
     hostBuilder.AddAzureBlobGrainStorage("PubSubStore", (AzureBlobStorageOptions options) =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     });
 }
Esempio n. 10
0
 public void Configure(ISiloBuilder hostBuilder)
 {
     hostBuilder.AddAzureBlobGrainStorage("AzureStore", (AzureBlobStorageOptions options) =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     })
     .AddAzureBlobGrainStorage("AzureStore1", (AzureBlobStorageOptions options) =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     })
     .AddAzureBlobGrainStorage("AzureStore2", (AzureBlobStorageOptions options) =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     })
     .AddAzureBlobGrainStorage("AzureStore3", (AzureBlobStorageOptions options) =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     })
     .AddAzureBlobGrainStorage("GrainStorageForTest", (AzureBlobStorageOptions options) =>
     {
         options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
     })
     .AddMemoryGrainStorage("MemoryStore");
 }
 /// <summary>
 /// Configure silo to use azure blob storage as the default grain storage.
 /// </summary>
 public static ISiloBuilder AddAzureBlobGrainStorageAsDefault(this ISiloBuilder builder, Action <OptionsBuilder <AzureBlobStorageOptions> > configureOptions = null)
 {
     return(builder.AddAzureBlobGrainStorage(ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME, configureOptions));
 }