private static void InitClusterNode(ClusterNode node)
{
node.RootActors = new List<IActorRef>();
foreach (var role in node.Roles)
{
IActorRef rootActor;
switch (role)
{
case "table":
rootActor = node.Context.System.ActorOf(Props.Create(
() => new Table("TestTable", node.Context.ClusterActorDiscovery,
typeof(IncrementalIntegerIdGenerator), null)));
break;
case "container":
rootActor = node.Context.System.ActorOf(Props.Create(
() => new TableContainer("TestTable", node.Context.ClusterActorDiscovery,
typeof(CommonActorFactory<TestActor>), null, null)));
break;
default:
throw new InvalidOperationException("Invalid role: " + role);
}
node.RootActors.Add(rootActor);
}
}