com.ace.moab.api.reservation
Class Task

java.lang.Object
  extended by com.ace.moab.api.reservation.Task
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Task>

public class Task
extends java.lang.Object
implements java.lang.Comparable<Task>, java.io.Serializable

An atomic collection of resources, such as processors, memory, or local disk space, which must be found on the same node. A reservation may request some positive integer value of Tasks, or may specify a host list.

See Also:
Serialized Form

Constructor Summary
Task()
           
 
Method Summary
 int compareTo(Task o)
           
 boolean equals(java.lang.Object other)
           
 int getDisk()
          Returns the amount of disk space (in mBs).
 java.util.Map<java.lang.String,java.lang.Integer> getGenericResources()
          Gets the map of all the generic resources with the associated amounts in this task.
 int getMemory()
          Returns the amount of memory (in mBs)
 int getProcs()
          Returns the number of processors defined in this task.
 java.lang.String getResourceRequestString()
          Returns the task definition in the format for requesting resources.
 int getSwap()
          Returns the amount of swap space (in mBs).
 void setDisk(int disk)
          Sets the amount of disk space (in mBs).
 void setGenericResource(java.lang.String genericResource, int amount)
          Sets the amount of a given generic resource to be included in the task.
 void setGenericResources(java.util.Map<java.lang.String,java.lang.Integer> genericResources)
          Sets the map of all the generic resources with the associated amounts in this task.
 void setMemory(int memory)
          Sets the amount of memory (in mBs).
 void setProcs(int procs)
          Sets the number of processors defined in this task.
 void setSwap(int swap)
          Sets the amount of swap space (in mBs).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Task

public Task()
Method Detail

getProcs

public int getProcs()
Returns the number of processors defined in this task.

Returns:
the number of processors defined in this task.

setProcs

public void setProcs(int procs)
Sets the number of processors defined in this task.

Parameters:
procs - the number of processors defined in this task.

getMemory

public int getMemory()
Returns the amount of memory (in mBs)

Returns:
the amount of memory (in mBs)

setMemory

public void setMemory(int memory)
Sets the amount of memory (in mBs).

Parameters:
memory - the amount of memory (in mBs).

getDisk

public int getDisk()
Returns the amount of disk space (in mBs).

Returns:
the amount of disk space (in mBs).

setDisk

public void setDisk(int disk)
Sets the amount of disk space (in mBs).

Parameters:
disk - the amount of disk space (in mBs).

getSwap

public int getSwap()
Returns the amount of swap space (in mBs).

Returns:
the amount of swap space (in mBs).

setSwap

public void setSwap(int swap)
Sets the amount of swap space (in mBs).

Parameters:
swap - the amount of swap space (in mBs).

setGenericResource

public void setGenericResource(java.lang.String genericResource,
                               int amount)
Sets the amount of a given generic resource to be included in the task.

Parameters:
genericResource - The name of the generic resource.
amount - The amount of the resource in the task.

getGenericResources

public java.util.Map<java.lang.String,java.lang.Integer> getGenericResources()
Gets the map of all the generic resources with the associated amounts in this task.

Can be null.

Returns:
The map of all the generic resources and their associated amounts.

setGenericResources

public void setGenericResources(java.util.Map<java.lang.String,java.lang.Integer> genericResources)
Sets the map of all the generic resources with the associated amounts in this task.

Can be null.

Parameters:
genericResources - the generic resources and their associated amounts

getResourceRequestString

public java.lang.String getResourceRequestString()
Returns the task definition in the format for requesting resources. The format is <RESTYPE>:<COUNT>(+<RESTYPE>:<COUNT>)... where <RESTYPE> is one of procs, mem, disk, or swap.

Returns:
the task definition formatted for requesting resources.

compareTo

public int compareTo(Task o)
Specified by:
compareTo in interface java.lang.Comparable<Task>

equals

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


Copyright © 2001-2009 Cluster Resources, Inc. All Rights Reserved.