Package net.sodacan.core.coordinator
Class SingleHostCoordinator
java.lang.Object
net.sodacan.core.coordinator.AbstractCoordinator
net.sodacan.core.coordinator.SingleHostCoordinator
- All Implemented Interfaces:
Coordinator
For this Single host coordinator, the static configuration is provided and used. Only a single Host is provided and that host hosts all possible actorGroups. An existing single-host setup can be upgraded to a cluster configuration when the time comes without affecting how Actors are implemented.
-
Field Summary
Fields inherited from class net.sodacan.core.coordinator.AbstractCoordinator
config
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA simple one host coordinator.getHostsForActorGroup
(int agNumber) This returns the hosts, including the current host, as to where messages should be sent.int
getLiveHostForActorGroup
(int agNumber) toString()
Methods inherited from class net.sodacan.core.coordinator.AbstractCoordinator
getConfig
-
Constructor Details
-
SingleHostCoordinator
-
-
Method Details
-
toString
-
getActorGroupsForHost
A simple one host coordinator. The host number is taken from the configuration. And the groups are numbered from 1 to config.actorGroups+1. All groups are Live on this one host. This list controls the lifecycle of the ActorGroups on this host.
- Specified by:
getActorGroupsForHost
in interfaceCoordinator
-
getHostsForActorGroup
This returns the hosts, including the current host, as to where messages should be sent.
- Specified by:
getHostsForActorGroup
in interfaceCoordinator
- Returns:
-
getLiveHostForActorGroup
public int getLiveHostForActorGroup(int agNumber) - Specified by:
getLiveHostForActorGroup
in interfaceCoordinator
-