Class AtomixLeaderElector

  • All Implemented Interfaces:
    org.onosproject.store.service.AsyncLeaderElector, org.onosproject.store.service.DistributedPrimitive

    public class AtomixLeaderElector
    extends java.lang.Object
    implements org.onosproject.store.service.AsyncLeaderElector
    Atomix leader elector.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.onosproject.store.service.DistributedPrimitive

        org.onosproject.store.service.DistributedPrimitive.Status, org.onosproject.store.service.DistributedPrimitive.Type
    • Field Summary

      • Fields inherited from interface org.onosproject.store.service.DistributedPrimitive

        DEFAULT_OPERATION_TIMEOUT_MILLIS
    • Constructor Summary

      Constructors 
      Constructor Description
      AtomixLeaderElector​(io.atomix.core.election.AsyncLeaderElector<org.onosproject.cluster.NodeId> atomixElector, org.onosproject.cluster.NodeId localNodeId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.lang.Void> addChangeListener​(java.util.function.Consumer<org.onosproject.event.Change<org.onosproject.cluster.Leadership>> consumer)  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> anoint​(java.lang.String topic, org.onosproject.cluster.NodeId nodeId)  
      java.util.concurrent.CompletableFuture<java.lang.Void> evict​(org.onosproject.cluster.NodeId nodeId)  
      java.util.concurrent.CompletableFuture<org.onosproject.cluster.Leadership> getLeadership​(java.lang.String topic)  
      java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,​org.onosproject.cluster.Leadership>> getLeaderships()  
      java.lang.String name()  
      java.util.concurrent.CompletableFuture<java.lang.Boolean> promote​(java.lang.String topic, org.onosproject.cluster.NodeId nodeId)  
      java.util.concurrent.CompletableFuture<java.lang.Void> removeChangeListener​(java.util.function.Consumer<org.onosproject.event.Change<org.onosproject.cluster.Leadership>> consumer)  
      java.util.concurrent.CompletableFuture<org.onosproject.cluster.Leadership> run​(java.lang.String topic, org.onosproject.cluster.NodeId nodeId)  
      java.util.concurrent.CompletableFuture<java.lang.Void> withdraw​(java.lang.String topic)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.onosproject.store.service.AsyncLeaderElector

        asLeaderElector, asLeaderElector, primitiveType
      • Methods inherited from interface org.onosproject.store.service.DistributedPrimitive

        addStatusChangeListener, applicationId, destroy, removeStatusChangeListener, statusChangeListeners
    • Constructor Detail

      • AtomixLeaderElector

        public AtomixLeaderElector​(io.atomix.core.election.AsyncLeaderElector<org.onosproject.cluster.NodeId> atomixElector,
                                   org.onosproject.cluster.NodeId localNodeId)
    • Method Detail

      • name

        public java.lang.String name()
        Specified by:
        name in interface org.onosproject.store.service.DistributedPrimitive
      • run

        public java.util.concurrent.CompletableFuture<org.onosproject.cluster.Leadership> run​(java.lang.String topic,
                                                                                              org.onosproject.cluster.NodeId nodeId)
        Specified by:
        run in interface org.onosproject.store.service.AsyncLeaderElector
      • withdraw

        public java.util.concurrent.CompletableFuture<java.lang.Void> withdraw​(java.lang.String topic)
        Specified by:
        withdraw in interface org.onosproject.store.service.AsyncLeaderElector
      • anoint

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> anoint​(java.lang.String topic,
                                                                                org.onosproject.cluster.NodeId nodeId)
        Specified by:
        anoint in interface org.onosproject.store.service.AsyncLeaderElector
      • evict

        public java.util.concurrent.CompletableFuture<java.lang.Void> evict​(org.onosproject.cluster.NodeId nodeId)
        Specified by:
        evict in interface org.onosproject.store.service.AsyncLeaderElector
      • promote

        public java.util.concurrent.CompletableFuture<java.lang.Boolean> promote​(java.lang.String topic,
                                                                                 org.onosproject.cluster.NodeId nodeId)
        Specified by:
        promote in interface org.onosproject.store.service.AsyncLeaderElector
      • getLeadership

        public java.util.concurrent.CompletableFuture<org.onosproject.cluster.Leadership> getLeadership​(java.lang.String topic)
        Specified by:
        getLeadership in interface org.onosproject.store.service.AsyncLeaderElector
      • getLeaderships

        public java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,​org.onosproject.cluster.Leadership>> getLeaderships()
        Specified by:
        getLeaderships in interface org.onosproject.store.service.AsyncLeaderElector
      • addChangeListener

        public java.util.concurrent.CompletableFuture<java.lang.Void> addChangeListener​(java.util.function.Consumer<org.onosproject.event.Change<org.onosproject.cluster.Leadership>> consumer)
        Specified by:
        addChangeListener in interface org.onosproject.store.service.AsyncLeaderElector
      • removeChangeListener

        public java.util.concurrent.CompletableFuture<java.lang.Void> removeChangeListener​(java.util.function.Consumer<org.onosproject.event.Change<org.onosproject.cluster.Leadership>> consumer)
        Specified by:
        removeChangeListener in interface org.onosproject.store.service.AsyncLeaderElector