本文整理汇总了C#中Orleans.Runtime.Configuration.ClusterConfiguration.StandardLoad方法的典型用法代码示例。如果您正苦于以下问题:C# ClusterConfiguration.StandardLoad方法的具体用法?C# ClusterConfiguration.StandardLoad怎么用?C# ClusterConfiguration.StandardLoad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orleans.Runtime.Configuration.ClusterConfiguration
的用法示例。
在下文中一共展示了ClusterConfiguration.StandardLoad方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestInitialize
public void TestInitialize()
{
MessagingStatisticsGroup.Init(false);
var orleansConfig = new ClusterConfiguration();
orleansConfig.StandardLoad();
BufferPool.InitGlobalBufferPool(orleansConfig.Globals);
SerializationManager.InitializeForTesting();
}
示例2: MessageSerializerTests
public MessageSerializerTests(ITestOutputHelper output)
{
this.output = output;
MessagingStatisticsGroup.Init(false);
var orleansConfig = new ClusterConfiguration();
orleansConfig.StandardLoad();
BufferPool.InitGlobalBufferPool(orleansConfig.Globals);
SerializationManager.InitializeForTesting();
}
示例3: Run
public override void Run()
{
Trace.WriteLine("OrleansAzureSilos-Run entry point called", "Information");
Trace.WriteLine("OrleansAzureSilos-OnStart Starting Orleans silo", "Information");
var config = new ClusterConfiguration();
config.StandardLoad();
// 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(RoleEnvironment.DeploymentId, RoleEnvironment.CurrentRoleInstance, config);
Trace.WriteLine("OrleansAzureSilos-OnStart Orleans silo started ok=" + ok, "Information");
orleansAzureSilo.Run(); // Call will block until silo is shutdown
}
示例4: LogFileName
public void LogFileName()
{
var oc = new ClusterConfiguration();
oc.StandardLoad();
NodeConfiguration n = oc.CreateNodeConfigurationForSilo("Node1");
string fname = n.TraceFileName;
Assert.IsNotNull(fname);
Assert.IsFalse(fname.Contains(":"), "Log file name should not contain colons.");
// Check that .NET is happy with the file name
var f = new FileInfo(fname);
Assert.IsNotNull(f.Name);
Assert.AreEqual(fname, f.Name);
}
示例5: StartOrleansSilo
// This is a static version that can be called without a TestingSiloHost object (host = null)
public static SiloHandle StartOrleansSilo(TestingSiloHost host, Silo.SiloType type, TestingSiloOptions options, int instanceCount, AppDomain shared = null)
{
// Load initial config settings, then apply some overrides below.
ClusterConfiguration config = new ClusterConfiguration();
if (options.SiloConfigFile == null)
{
config.StandardLoad();
}
else
{
config.LoadFromFile(options.SiloConfigFile.FullName);
}
int basePort = options.BasePort < 0 ? BasePort : options.BasePort;
if (config.Globals.SeedNodes.Count > 0 && options.BasePort < 0)
{
config.PrimaryNode = config.Globals.SeedNodes[0];
}
else
{
config.PrimaryNode = new IPEndPoint(IPAddress.Loopback, basePort);
}
config.Globals.SeedNodes.Clear();
config.Globals.SeedNodes.Add(config.PrimaryNode);
if (!String.IsNullOrEmpty(DeploymentId))
{
config.Globals.DeploymentId = DeploymentId;
}
config.Defaults.PropagateActivityId = options.PropagateActivityId;
if (options.LargeMessageWarningThreshold > 0)
{
config.Defaults.LargeMessageWarningThreshold = options.LargeMessageWarningThreshold;
}
config.Globals.LivenessType = options.LivenessType;
config.Globals.ReminderServiceType = options.ReminderServiceType;
if (!String.IsNullOrEmpty(options.DataConnectionString))
{
config.Globals.DataConnectionString = options.DataConnectionString;
}
_livenessStabilizationTime = GetLivenessStabilizationTime(config.Globals);
if (host != null)
{
host.Globals = config.Globals;
}
string siloName;
switch (type)
{
case Silo.SiloType.Primary:
siloName = "Primary";
break;
default:
siloName = "Secondary_" + instanceCount.ToString(CultureInfo.InvariantCulture);
break;
}
NodeConfiguration nodeConfig = config.GetConfigurationForNode(siloName);
nodeConfig.HostNameOrIPAddress = "loopback";
nodeConfig.Port = basePort + instanceCount;
nodeConfig.DefaultTraceLevel = config.Defaults.DefaultTraceLevel;
nodeConfig.PropagateActivityId = config.Defaults.PropagateActivityId;
nodeConfig.BulkMessageLimit = config.Defaults.BulkMessageLimit;
if (nodeConfig.ProxyGatewayEndpoint != null && nodeConfig.ProxyGatewayEndpoint.Address != null)
{
int proxyBasePort = options.ProxyBasePort < 0 ? ProxyBasePort : options.ProxyBasePort;
nodeConfig.ProxyGatewayEndpoint = new IPEndPoint(nodeConfig.ProxyGatewayEndpoint.Address, proxyBasePort + instanceCount);
}
config.Globals.ExpectedClusterSize = 2;
config.Overrides[siloName] = nodeConfig;
AdjustForTest(config, options);
WriteLog("Starting a new silo in app domain {0} with config {1}", siloName, config.ToString(siloName));
AppDomain appDomain;
Silo silo = LoadSiloInNewAppDomain(siloName, type, config, out appDomain);
silo.Start();
SiloHandle retValue = new SiloHandle
{
Name = siloName,
Silo = silo,
Options = options,
Endpoint = silo.SiloAddress.Endpoint,
AppDomain = appDomain,
};
ImportGeneratedAssemblies(retValue);
return retValue;
}
示例6: InitSchedulerLogging
internal static void InitSchedulerLogging()
{
LogManager.UnInitialize();
//LogManager.LogConsumers.Add(new LogWriterToConsole());
if (!LogManager.TelemetryConsumers.OfType<ConsoleTelemetryConsumer>().Any())
{
LogManager.TelemetryConsumers.Add(new ConsoleTelemetryConsumer());
}
var traceLevels = new[]
{
Tuple.Create("Scheduler", Severity.Verbose3),
Tuple.Create("Scheduler.WorkerPoolThread", Severity.Verbose2),
};
LogManager.SetTraceLevelOverrides(new List<Tuple<string, Severity>>(traceLevels));
var orleansConfig = new ClusterConfiguration();
orleansConfig.StandardLoad();
NodeConfiguration config = orleansConfig.CreateNodeConfigurationForSilo("Primary");
StatisticsCollector.Initialize(config);
SchedulerStatisticsGroup.Init();
}
示例7: StartOrleansSilo
/// <summary>
/// Start a new silo in the target cluster
/// </summary>
/// <param name="host">The target cluster</param>
/// <param name="type">The type of the silo to deploy</param>
/// <param name="options">The options to use for the silo</param>
/// <param name="instanceCount">The instance count of the silo</param>
/// <param name="shared">The shared AppDomain to use</param>
/// <returns>A handle to the deployed silo</returns>
public static SiloHandle StartOrleansSilo(TestingSiloHost host, Silo.SiloType type, TestingSiloOptions options, int instanceCount, AppDomain shared = null)
{
if (host == null) throw new ArgumentNullException("host");
// Load initial config settings, then apply some overrides below.
ClusterConfiguration config = new ClusterConfiguration();
try
{
if (options.SiloConfigFile == null)
{
config.StandardLoad();
}
else
{
config.LoadFromFile(options.SiloConfigFile.FullName);
}
}
catch (FileNotFoundException)
{
if (options.SiloConfigFile != null
&& !string.Equals(options.SiloConfigFile.Name, TestingSiloOptions.DEFAULT_SILO_CONFIG_FILE, StringComparison.InvariantCultureIgnoreCase))
{
// if the user is not using the defaults, then throw because the file was legitimally not found
throw;
}
config = ClusterConfiguration.LocalhostPrimarySilo();
config.AddMemoryStorageProvider("Default");
config.AddMemoryStorageProvider("MemoryStore");
}
int basePort = options.BasePort < 0 ? BasePort : options.BasePort;
if (config.Globals.SeedNodes.Count > 0 && options.BasePort < 0)
{
config.PrimaryNode = config.Globals.SeedNodes[0];
}
else
{
config.PrimaryNode = new IPEndPoint(IPAddress.Loopback, basePort);
}
config.Globals.SeedNodes.Clear();
config.Globals.SeedNodes.Add(config.PrimaryNode);
if (!String.IsNullOrEmpty(host.DeploymentId))
{
config.Globals.DeploymentId = host.DeploymentId;
}
config.Defaults.PropagateActivityId = options.PropagateActivityId;
if (options.LargeMessageWarningThreshold > 0)
{
config.Defaults.LargeMessageWarningThreshold = options.LargeMessageWarningThreshold;
}
config.Globals.LivenessType = options.LivenessType;
config.Globals.ReminderServiceType = options.ReminderServiceType;
if (!String.IsNullOrEmpty(options.DataConnectionString))
{
config.Globals.DataConnectionString = options.DataConnectionString;
}
host.Globals = config.Globals;
string siloName;
switch (type)
{
case Silo.SiloType.Primary:
siloName = "Primary";
break;
default:
siloName = "Secondary_" + instanceCount.ToString(CultureInfo.InvariantCulture);
break;
}
NodeConfiguration nodeConfig = config.GetOrCreateNodeConfigurationForSilo(siloName);
nodeConfig.HostNameOrIPAddress = "loopback";
nodeConfig.Port = basePort + instanceCount;
nodeConfig.DefaultTraceLevel = config.Defaults.DefaultTraceLevel;
nodeConfig.PropagateActivityId = config.Defaults.PropagateActivityId;
nodeConfig.BulkMessageLimit = config.Defaults.BulkMessageLimit;
int? gatewayport = null;
if (nodeConfig.ProxyGatewayEndpoint != null && nodeConfig.ProxyGatewayEndpoint.Address != null)
{
gatewayport = (options.ProxyBasePort < 0 ? ProxyBasePort : options.ProxyBasePort) + instanceCount;
nodeConfig.ProxyGatewayEndpoint = new IPEndPoint(nodeConfig.ProxyGatewayEndpoint.Address, gatewayport.Value);
}
config.Globals.ExpectedClusterSize = 2;
//.........这里部分代码省略.........
示例8: LogFileName
public void LogFileName()
{
var oc = new ClusterConfiguration();
oc.StandardLoad();
var n = oc.GetOrAddConfigurationForNode("Node1");
string fname = n.TraceFileName;
Console.WriteLine("LogFileName = " + fname);
Assert.IsNotNull(fname);
Assert.IsFalse(fname.Contains(":"), "Log file name should not contain colons.");
// Check that .NET is happy with the file name
var f = new FileInfo(fname);
Assert.IsNotNull(f.Name);
Assert.AreEqual(fname, f.Name);
}