Enum Class Edge.RoutingPolicy

java.lang.Object
java.lang.Enum<Edge.RoutingPolicy>
com.hazelcast.jet.core.Edge.RoutingPolicy
All Implemented Interfaces:
Serializable, Comparable<Edge.RoutingPolicy>, Constable
Enclosing class:
Edge

public static enum Edge.RoutingPolicy extends Enum<Edge.RoutingPolicy> implements Serializable
An edge describes a connection from many upstream processors to many downstream processors. The routing policy decides where exactly to route each particular item emitted from an upstream processor. To simplify the reasoning we introduce the concept of the set of candidate downstream processors, or the candidate set for short. On a local edge the candidate set contains only local processors and on a distributed edge it contains all the processors.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    This policy sends each item to all candidate processors.
    This policy sends an item to all members, but only to one processor on each member.
    This policy sets up isolated parallel data paths between two vertices as much as it can, given the level of mismatch between the local parallelism (LP) of the upstream vs. the downstream vertices.
    This policy sends every item to the one processor responsible for the item's partition ID.
    This policy chooses for each item a single destination processor from the candidate set, with no restriction on the choice.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • UNICAST

      public static final Edge.RoutingPolicy UNICAST
      This policy chooses for each item a single destination processor from the candidate set, with no restriction on the choice.
    • ISOLATED

      public static final Edge.RoutingPolicy ISOLATED
      This policy sets up isolated parallel data paths between two vertices as much as it can, given the level of mismatch between the local parallelism (LP) of the upstream vs. the downstream vertices. Specifically:
      • If LP_upstream <= LP_downstream, every downstream processor receives data from only one upstream processor
      • If LP_upstream >= LP_downstream, every upstream processor sends data to only one downstream processor
      If LP_upstream = LP_downstream, both of the above are true and there are isolated pairs of upstream and downstream processors.

      This policy is only available on a local edge.

    • PARTITIONED

      public static final Edge.RoutingPolicy PARTITIONED
      This policy sends every item to the one processor responsible for the item's partition ID. On a distributed edge, this processor is unique across the cluster; on a non-distributed edge, the processor is unique only within a member.
    • BROADCAST

      public static final Edge.RoutingPolicy BROADCAST
      This policy sends each item to all candidate processors.
    • FANOUT

      public static final Edge.RoutingPolicy FANOUT
      This policy sends an item to all members, but only to one processor on each member. It's a combination of BROADCAST and UNICAST: an item is first broadcast to all members, and then, on each member, it is unicast to one processor.

      If the destination local parallelism is 1, the behavior is equal to BROADCAST. If the member count in the cluster is 1, the behavior is equal to UNICAST.

      To work as expected, the edge must be also Edge.distributed(). Otherwise, it will work just like UNICAST.

      Since:
      Jet 4.4
  • Method Details

    • values

      public static Edge.RoutingPolicy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Edge.RoutingPolicy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null