Class RoundRobinLocator

  • All Implemented Interfaces:
    Locator

    public class RoundRobinLocator
    extends Object
    implements Locator
    A Locator which implements node selection on a round-robin basis.

    This locator simply tracks a counter that gets incremented and applied to the list of nodes provided. The list of nodes is filtered to make sure that only nodes with the specific service are taken into account.

    Since:
    1.0.0
    • Constructor Detail

      • RoundRobinLocator

        public RoundRobinLocator​(ServiceType serviceType)
    • Method Detail

      • dispatch

        public void dispatch​(Request<? extends Response> request,
                             List<Node> nodes,
                             ClusterConfig config,
                             CoreContext ctx)
        Description copied from interface: Locator
        Given the environment and node information, the implementation locates the right set of nodes and dispatches the request into them.
        Specified by:
        dispatch in interface Locator
        Parameters:
        request - the request to dispatch.
        nodes - the current list of active nodes.
        config - the current cluster configuration.
        ctx - the core context.