Class SingleHostCoordinator

java.lang.Object
net.sodacan.core.coordinator.AbstractCoordinator
net.sodacan.core.coordinator.SingleHostCoordinator
All Implemented Interfaces:
Coordinator

public class SingleHostCoordinator extends AbstractCoordinator implements 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.

  • Constructor Details

    • SingleHostCoordinator

      public SingleHostCoordinator(Config config)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getActorGroupsForHost

      public List<HostEntry> 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 interface Coordinator
    • getHostsForActorGroup

      public List<Integer> getHostsForActorGroup(int agNumber)

      This returns the hosts, including the current host, as to where messages should be sent.

      Specified by:
      getHostsForActorGroup in interface Coordinator
      Returns:
    • getLiveHostForActorGroup

      public int getLiveHostForActorGroup(int agNumber)
      Specified by:
      getLiveHostForActorGroup in interface Coordinator