p2pMapReduce.nodeModule.nodeFsm
Class Master

java.lang.Object
  extended by p2pMapReduce.nodeModule.nodeFsm.State
      extended by p2pMapReduce.nodeModule.nodeFsm.NodeState
          extended by p2pMapReduce.nodeModule.nodeFsm.Master

public class Master
extends NodeState

A FSM macro state representing a master node.


Nested Class Summary
 
Nested classes/interfaces inherited from class p2pMapReduce.nodeModule.nodeFsm.NodeState
NodeState.StateName
 
Constructor Summary
Master(NodeFSM aThis)
           
 
Method Summary
 void backupJobAssigned(PrimaryJob primaryJob, java.lang.String primaryNodeID)
           
 void backupJobCompleted(java.lang.String completedJobID)
           
 void backupMasterFailure(java.lang.String failedBackupID)
           
 void becomeSlave()
           
 void coordinatorFailure()
           
 void electionMessage(java.lang.String senderID)
          Invoked when an election message is received from another master In ELECTING_COORDINATOR state from a master which is taking part in the election algorithm In WAITING_COORDINATOR state from the new coordinator
protected  void entryAction()
          The method to call each time an FSM transit to this state, after leaving the previous state
 void jobAssigned(Job job, NodeInfo userNodeInfo)
           
 void jobCompleted(java.lang.String jobID, JobStatus.State jobState)
           
 void jobIDRequest(int requestNumber, NodeInfo userNodeInfo)
          Used by an user node to request a new unique JobID
 void jobReassigned(BackupJob bJ)
           
 void jobUpdate(java.lang.String jobID, java.util.LinkedList<java.lang.String> updatedBackupMasterList, java.util.LinkedList<JobTask> updatedJobTaskList)
           
 void newCoordinator(java.lang.String senderID)
          Invoked when a new coordinator id is received by another master.
 void outputRetrieved(JobTask reduceJT, boolean completionState)
          Received by JobManager.
 void primaryElectionMessage(java.lang.String jobID, java.lang.String senderID, double senderLoad)
           
 void primaryMasterFailure(java.lang.String primaryID)
           
 void primaryUpdate(java.lang.String jobID, java.lang.String updatedPrimaryID, double updatedPrimaryLoad)
           
 void slaveCheck(java.lang.String taskID)
           
 void slaveFailure(java.lang.String failedSlaveID)
           
 void taskCompleted(java.lang.String taskAttID, Task.TaskStatus taskStatus)
          The MANGMENT macro state can receive a taskCompleted message that must be propagate to the relative JobManager
 
Methods inherited from class p2pMapReduce.nodeModule.nodeFsm.NodeState
becomeMaster, getNextTimeout, taskAssigned, timeout
 
Methods inherited from class p2pMapReduce.nodeModule.nodeFsm.State
exitAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Master

public Master(NodeFSM aThis)
Method Detail

entryAction

protected void entryAction()
Description copied from class: State
The method to call each time an FSM transit to this state, after leaving the previous state

Overrides:
entryAction in class State

becomeSlave

public void becomeSlave()
Overrides:
becomeSlave in class NodeState

electionMessage

public void electionMessage(java.lang.String senderID)
Description copied from class: NodeState
Invoked when an election message is received from another master In ELECTING_COORDINATOR state from a master which is taking part in the election algorithm In WAITING_COORDINATOR state from the new coordinator

Overrides:
electionMessage in class NodeState
Parameters:
senderID - The node id of the message sender

newCoordinator

public void newCoordinator(java.lang.String senderID)
Description copied from class: NodeState
Invoked when a new coordinator id is received by another master.

Overrides:
newCoordinator in class NodeState
Parameters:
senderID - The node id of the message sender that has become the new Coordinator

coordinatorFailure

public void coordinatorFailure()
Overrides:
coordinatorFailure in class NodeState

jobIDRequest

public void jobIDRequest(int requestNumber,
                         NodeInfo userNodeInfo)
Description copied from class: NodeState
Used by an user node to request a new unique JobID

Overrides:
jobIDRequest in class NodeState

jobAssigned

public void jobAssigned(Job job,
                        NodeInfo userNodeInfo)
Overrides:
jobAssigned in class NodeState

slaveCheck

public void slaveCheck(java.lang.String taskID)
Overrides:
slaveCheck in class NodeState

jobReassigned

public void jobReassigned(BackupJob bJ)
Overrides:
jobReassigned in class NodeState

taskCompleted

public void taskCompleted(java.lang.String taskAttID,
                          Task.TaskStatus taskStatus)
The MANGMENT macro state can receive a taskCompleted message that must be propagate to the relative JobManager

Overrides:
taskCompleted in class NodeState
Parameters:
taskAttID -
taskStatus -

outputRetrieved

public void outputRetrieved(JobTask reduceJT,
                            boolean completionState)
Description copied from class: NodeState
Received by JobManager. Notify the success state of reduceJT output retrieving by user node.

Overrides:
outputRetrieved in class NodeState

jobCompleted

public void jobCompleted(java.lang.String jobID,
                         JobStatus.State jobState)
Overrides:
jobCompleted in class NodeState

slaveFailure

public void slaveFailure(java.lang.String failedSlaveID)
Overrides:
slaveFailure in class NodeState

backupMasterFailure

public void backupMasterFailure(java.lang.String failedBackupID)
Overrides:
backupMasterFailure in class NodeState

primaryMasterFailure

public void primaryMasterFailure(java.lang.String primaryID)
Overrides:
primaryMasterFailure in class NodeState

backupJobAssigned

public void backupJobAssigned(PrimaryJob primaryJob,
                              java.lang.String primaryNodeID)
Overrides:
backupJobAssigned in class NodeState

primaryElectionMessage

public void primaryElectionMessage(java.lang.String jobID,
                                   java.lang.String senderID,
                                   double senderLoad)
Overrides:
primaryElectionMessage in class NodeState

primaryUpdate

public void primaryUpdate(java.lang.String jobID,
                          java.lang.String updatedPrimaryID,
                          double updatedPrimaryLoad)
Overrides:
primaryUpdate in class NodeState

jobUpdate

public void jobUpdate(java.lang.String jobID,
                      java.util.LinkedList<java.lang.String> updatedBackupMasterList,
                      java.util.LinkedList<JobTask> updatedJobTaskList)
Overrides:
jobUpdate in class NodeState

backupJobCompleted

public void backupJobCompleted(java.lang.String completedJobID)
Overrides:
backupJobCompleted in class NodeState