org.ourgrid.mygrid.scheduler.jobmanager
Class ReplicaEntry

java.lang.Object
  extended by org.ourgrid.mygrid.scheduler.jobmanager.ReplicaEntry
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FakeScheduler.FakeReplica

public class ReplicaEntry
extends java.lang.Object
implements java.io.Serializable

A replica is the lower level abstraction that is executed on the GridMachines. It contains all necessary information to run a a job task. All replicas of a task differ only in their identification, the remaining information is the same to all replicas. In other words, a replica is a representation of a task to be executed on the remote machines.

See Also:
Serialized Form

Constructor Summary
ReplicaEntry(int id, int taskId, int jobId, TaskSpec taskSpec)
          The constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 GumID getGumID()
          Returns the ID of the GridMachine assigned to execute this replica.
 int getId()
          Returns the identification of this replica.
 int getJobId()
          Returns the owner job identification.
 ReplicaExecutorResult getResult()
          Gets the ReplicaExecutorResult of this replica.
 TaskSpec getSpec()
          Returns the TaskSpec of this replica.
 ExecutionStatus getStatus()
          Returns the state of the replica.
 int getTaskId()
          Returns the owner task identification.
 void setGumID(GumID gumID)
          Sets the ID of the GridMachine assigned to execute this replica.
 void setResult(ReplicaExecutorResult result)
          Sets the ReplicaExecutorResult of this replica.
 void setStatus(ExecutionStatus state)
          Sets the state of the replica.
 java.lang.String toString()
          Returns a unique string representation for this replica.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReplicaEntry

public ReplicaEntry(int id,
                    int taskId,
                    int jobId,
                    TaskSpec taskSpec)
The constructor.

Parameters:
id - The replica id
taskId - The task id
jobId - The job id
Method Detail

getSpec

public TaskSpec getSpec()
Returns the TaskSpec of this replica.

Returns:
The TaskSpec

setStatus

public void setStatus(ExecutionStatus state)
Sets the state of the replica.

Parameters:
state - The new state of the replica

getStatus

public ExecutionStatus getStatus()
Returns the state of the replica.

Returns:
The replica current status

getJobId

public int getJobId()
Returns the owner job identification.

Returns:
The job identification

getTaskId

public int getTaskId()
Returns the owner task identification.

Returns:
The task identification

getId

public int getId()
Returns the identification of this replica.

Returns:
The identification

setResult

public void setResult(ReplicaExecutorResult result)
Sets the ReplicaExecutorResult of this replica.

Parameters:
result - The result of the replica execution

getResult

public ReplicaExecutorResult getResult()
Gets the ReplicaExecutorResult of this replica.

Returns:
The result of the replica execution

toString

public java.lang.String toString()
Returns a unique string representation for this replica.

Overrides:
toString in class java.lang.Object
Returns:
A string representation for this replica.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getGumID

public GumID getGumID()
Returns the ID of the GridMachine assigned to execute this replica.

Returns:
The GridMachine ID.

setGumID

public void setGumID(GumID gumID)
Sets the ID of the GridMachine assigned to execute this replica.

Parameters:
gumID - The GridMachine ID.