Class Node

java.lang.Object
akka.actor.AbstractActor
it.unitn.disi.ds1.qtop.Node
All Implemented Interfaces:
akka.actor.Actor

public class Node extends akka.actor.AbstractActor
Node class, it represents a single node in the network. It can be either receiver or coordinator. During the election all the nodes become voters.
  • Nested Class Summary

    Nested classes/interfaces inherited from class akka.actor.AbstractActor

    akka.actor.AbstractActor.ActorContext, akka.actor.AbstractActor.Receive

    Nested classes/interfaces inherited from interface akka.actor.Actor

    akka.actor.Actor.emptyBehavior$, akka.actor.Actor.ignoringBehavior$
  • Constructor Summary

    Constructors
    Constructor
    Description
    Node(akka.actor.ActorRef coordinator, int nodeId, int voteTimeout, int writeTimeout, int electionGlobalTimeout, int numberOfNodes)
    Constructor for the Node class.
  • Method Summary

    Modifier and Type
    Method
    Description
    akka.actor.AbstractActor.Receive
    Mask for to the Receiver actor.
    static akka.actor.Props
    props(akka.actor.ActorRef coordinator, int nodeId, int voteTimeout, int writeTimeout, int electionGlobalTimeout, int numberOfNodes)
    Create the Props for the Node class.
    void
    tell(akka.actor.ActorRef dest, Object msg, akka.actor.ActorRef sender)
    Send a message to a destination actor with a random delay, within 0 and 29 milliseconds.

    Methods inherited from class akka.actor.AbstractActor

    akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, context, emptyBehavior, getContext, getSelf, getSender, postRestart, postStop, preRestart, preRestart, preStart, receive, receiveBuilder, self, supervisorStrategy

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface akka.actor.Actor

    aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, sender, unhandled
  • Constructor Details

    • Node

      public Node(akka.actor.ActorRef coordinator, int nodeId, int voteTimeout, int writeTimeout, int electionGlobalTimeout, int numberOfNodes)
      Constructor for the Node class.
      Parameters:
      coordinator - the coordinator ActorRef
      nodeId - the node ID
      voteTimeout - the vote timeout
      writeTimeout - the write timeout
      electionGlobalTimeout - the global election timeout
      numberOfNodes - the number of nodes in the network
  • Method Details

    • props

      public static akka.actor.Props props(akka.actor.ActorRef coordinator, int nodeId, int voteTimeout, int writeTimeout, int electionGlobalTimeout, int numberOfNodes)
      Create the Props for the Node class.
      Parameters:
      coordinator - the coordinator ActorRef
      nodeId - the node ID
      voteTimeout - the vote timeout
      writeTimeout - the write timeout
      electionGlobalTimeout - the global election timeout
      numberOfNodes - the number of nodes in the network
      Returns:
      the Props object
    • tell

      public void tell(akka.actor.ActorRef dest, Object msg, akka.actor.ActorRef sender)
      Send a message to a destination actor with a random delay, within 0 and 29 milliseconds.
      Parameters:
      dest - the destination actor
      msg - the message to send
      sender - the sender actor
    • createReceive

      public akka.actor.AbstractActor.Receive createReceive()
      Mask for to the Receiver actor.
      Specified by:
      createReceive in class akka.actor.AbstractActor
      Returns:
      the Receive object