Class WorkPartitionManager

  • All Implemented Interfaces:
    org.onosproject.event.ListenerService<org.onosproject.net.intent.WorkPartitionEvent,​org.onosproject.net.intent.WorkPartitionEventListener>, org.onosproject.net.intent.WorkPartitionService

    public class WorkPartitionManager
    extends java.lang.Object
    implements org.onosproject.net.intent.WorkPartitionService
    Manages the assignment of work partitions to instances.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.onosproject.cluster.ClusterService clusterService  
      protected org.onosproject.event.EventDeliveryService eventDispatcher  
      protected org.onosproject.cluster.LeadershipService leadershipService  
      protected org.onosproject.cluster.NodeId localNodeId  
      protected java.util.concurrent.atomic.AtomicBoolean rebalanceScheduled  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate()  
      void addListener​(org.onosproject.net.intent.WorkPartitionEventListener listener)  
      void deactivate()  
      <K> org.onosproject.cluster.NodeId getLeader​(K id, java.util.function.Function<K,​java.lang.Long> hasher)  
      <K> boolean isMine​(K id, java.util.function.Function<K,​java.lang.Long> hasher)  
      void removeListener​(org.onosproject.net.intent.WorkPartitionEventListener listener)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • leadershipService

        protected org.onosproject.cluster.LeadershipService leadershipService
      • clusterService

        protected org.onosproject.cluster.ClusterService clusterService
      • eventDispatcher

        protected org.onosproject.event.EventDeliveryService eventDispatcher
      • rebalanceScheduled

        protected final java.util.concurrent.atomic.AtomicBoolean rebalanceScheduled
      • localNodeId

        protected org.onosproject.cluster.NodeId localNodeId
    • Constructor Detail

      • WorkPartitionManager

        public WorkPartitionManager()
    • Method Detail

      • activate

        public void activate()
      • deactivate

        public void deactivate()
      • isMine

        public <K> boolean isMine​(K id,
                                  java.util.function.Function<K,​java.lang.Long> hasher)
        Specified by:
        isMine in interface org.onosproject.net.intent.WorkPartitionService
      • getLeader

        public <K> org.onosproject.cluster.NodeId getLeader​(K id,
                                                            java.util.function.Function<K,​java.lang.Long> hasher)
        Specified by:
        getLeader in interface org.onosproject.net.intent.WorkPartitionService
      • addListener

        public void addListener​(org.onosproject.net.intent.WorkPartitionEventListener listener)
        Specified by:
        addListener in interface org.onosproject.event.ListenerService<org.onosproject.net.intent.WorkPartitionEvent,​org.onosproject.net.intent.WorkPartitionEventListener>
      • removeListener

        public void removeListener​(org.onosproject.net.intent.WorkPartitionEventListener listener)
        Specified by:
        removeListener in interface org.onosproject.event.ListenerService<org.onosproject.net.intent.WorkPartitionEvent,​org.onosproject.net.intent.WorkPartitionEventListener>