|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gridlab.gat.resources.ResourceDescription
public abstract class ResourceDescription
The ResourceDescription
interface forms the base for the
SoftwareResourceDescription
s and HardwareResourceDescription
s
classes; these are used to specify and find resources which may then be used,
for example, to submit a Job
to. It has an associated Map
whose key/value pairs describe the resource.
A Job
may have many requirements, both on software and hardware,
which need to be satisfied to run, e.g. specific versions of the operating
system, minimum amount of memory, presence of specific compilers or libraries
on a system, etc. Each one of these requirements may itself possibly in turn
depend on some other software or hardware requirement. Sometimes there may be
possible alternatives, for example the Job
may be able to use any one
of a set of possible system libraries which might be installed. Hence, a
complete ResourceDescription
requires a list of possible
specifications, and, ideally, some way of specifying allowable alternatives.
In order to accommodate this, a ResourceDescription
has, as well as a
table describing software of hardware resource requirements, a list of child
ResourceDescription
s, at least one of which must be satisfied in
addition to the requirements of this ResourceDescription
.
Thus, a ResourceDescription
is a tree, and it is matched if a path
exists from the root of the tree to any leaf where the requirements of every
node on that path are met.
Method Summary | |
---|---|
void |
addResourceAttribute(String name,
Object value)
Adds the name/value pair to the Map <String ,
Object > of name/value pairs which describe this Resource . |
void |
addResourceDescription(ResourceDescription hardwareResourceDescription)
Adds the passed HardwareResourceDescription to the
List of HardwareResourceDescription s which
describe this Resource . |
boolean |
equals(Object object)
Tests this ResourceDescription for equality with the passed
Object . |
Map<String,Object> |
getDescription()
Gets the attributes associated with this instance |
Object |
getResourceAttribute(String name)
Returns an attribute of this description given the key. |
int |
hashCode()
|
void |
removeResourceAttribute(String name)
Removes the name/value pair with the passed name from the Map <String , Object > of name/value
pairs which describe this Resource . |
void |
removeResourceDescription(ResourceDescription hardwareResourceDescription)
Removes the passed HardwareResourceDescription from the
List of HardwareResourceDescription s which
describe this Resource . |
void |
setDescription(Map<String,Object> attributes)
Sets the attributes associated with this instance. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public boolean equals(Object object)
ResourceDescription
for equality with the passed
Object
.
If the given object is not a SoftwareResourceDescription
, then
this method immediately returns false.
If the passed object is a SoftwareResourceDescription
, then it
is equal if it has an equivalent SoftwareResourceDescription
,
and an equivalent SoftwareResourceDescription
s, and an
equivalent HardwareResourceDescription
s.
equals
in class Object
object
- The Object
to test for equality
public int hashCode()
hashCode
in class Object
public Map<String,Object> getDescription()
Map
<String
, Object
>, the
SoftwareResourceDescription
associated with this instancepublic void setDescription(Map<String,Object> attributes)
attributes
- The new Map
<String
,
Object
>, the SoftwareResourceDescription
associated with this instancepublic void addResourceAttribute(String name, Object value)
Map
<String
,
Object
> of name/value pairs which describe this Resource
.
name
- the key, a String
, to add to the
name/value pairs which describe this Resource
.value
- the value, an Object
, to add to the name/value
pairs which describes this Resource
.public Object getResourceAttribute(String name)
name
- the name of the attribute
null
if the key is not
presentpublic void removeResourceAttribute(String name)
Map
<String
, Object
> of name/value
pairs which describe this Resource
.
name
- The key, a String
, to of the name/value
pair to remove from the name/value pairs which describe
this Resource
.public void addResourceDescription(ResourceDescription hardwareResourceDescription)
HardwareResourceDescription
to the
List
of HardwareResourceDescription
s which
describe this Resource
.
hardwareResourceDescription
- The HardwareResourceDescription
to add to the
List
of
HardwareResourceDescription
s which describe this
Resource
.public void removeResourceDescription(ResourceDescription hardwareResourceDescription) throws NoSuchElementException
HardwareResourceDescription
from the
List
of HardwareResourceDescription
s which
describe this Resource
.
hardwareResourceDescription
- The HardwareResourceDescription
to remove from the
List
of
HardwareResourceDescription
s which describe this
Resource
.
NoSuchElementException
- the element to be removed cannot be foundpublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |