Interface WorkPartitionService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <K> NodeId getLeader​(K id, java.util.function.Function<K,​java.lang.Long> hasher)
      Returns the owner for a given identifier.
      <K> boolean isMine​(K id, java.util.function.Function<K,​java.lang.Long> hasher)
      Returns whether a given identifier maps to a partition owned by this instance.
    • Method Detail

      • isMine

        <K> boolean isMine​(K id,
                           java.util.function.Function<K,​java.lang.Long> hasher)
        Returns whether a given identifier maps to a partition owned by this instance.
        Type Parameters:
        K - entity type
        Parameters:
        id - identifier
        hasher - function that maps identifier to a long value
        Returns:
        true if the identifier maps to a partition owned by this instance, otherwise false
      • getLeader

        <K> NodeId getLeader​(K id,
                             java.util.function.Function<K,​java.lang.Long> hasher)
        Returns the owner for a given identifier.
        Type Parameters:
        K - entity type
        Parameters:
        id - identifier to query
        hasher - function that maps id to a long value
        Returns:
        the leader node identifier