edu.isi.pegasus.planner.selector.site.heft
Class HeftBag

java.lang.Object
  extended by edu.isi.pegasus.planner.selector.site.heft.HeftBag
All Implemented Interfaces:
Bag

public class HeftBag
extends Object
implements Bag

A data class that implements the Bag interface and stores the extra information that is required by the HEFT algorithm for each node.

Version:
$Revision: 2576 $
Author:
Karan Vahi

Field Summary
static Integer ACTUAL_FINISH_TIME
          The constant to be passed to the accessor functions to get or set the actual end time for a job.
static Integer ACTUAL_START_TIME
          The constant to be passed to the accessor functions to get or set the actual start time for a job.
static Integer AVG_COMPUTE_TIME
          The constant to be passed to the accessor functions to get or set the average compute time for the node.
static Integer DOWNWARD_RANK
          The constant to be passed to the accessor functions to get or set the downward rank for a node.
static String[] HEFTINFO
          Array storing the names of the attributes that are stored with the site.
private  float mAvgComputeTime
          The average compute time for a node.
private  float mDownwardRank
          The downward rank for a node.
private  long mEndTime
          The estimated end time for a job.
private  String mScheduledSite
          The site where a job is scheduled to run.
private  long mStartTime
          The estimated start time for a job.
private  float mUpwardRank
          The upward rank for a node.
static Integer SCHEDULED_SITE
          The site where the job is scheduled.
static Integer UPWARD_RANK
          The constant to be passed to the accessor functions to get or set the upward rank for a node.
 
Constructor Summary
HeftBag()
          The default constructor.
 
Method Summary
 boolean add(Object key, Object value)
          Adds an object to the underlying bag corresponding to a particular key.
 boolean containsKey(Object key)
          Returns true if the namespace contains a mapping for the specified key.
 Object get(Object key)
          Returns an objects corresponding to the key passed.
private  int getIntValue(Object key)
          A convenience method to get the intValue for the object passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEFTINFO

public static final String[] HEFTINFO
Array storing the names of the attributes that are stored with the site.


AVG_COMPUTE_TIME

public static final Integer AVG_COMPUTE_TIME
The constant to be passed to the accessor functions to get or set the average compute time for the node.


DOWNWARD_RANK

public static final Integer DOWNWARD_RANK
The constant to be passed to the accessor functions to get or set the downward rank for a node.


UPWARD_RANK

public static final Integer UPWARD_RANK
The constant to be passed to the accessor functions to get or set the upward rank for a node.


ACTUAL_START_TIME

public static final Integer ACTUAL_START_TIME
The constant to be passed to the accessor functions to get or set the actual start time for a job.


ACTUAL_FINISH_TIME

public static final Integer ACTUAL_FINISH_TIME
The constant to be passed to the accessor functions to get or set the actual end time for a job.


SCHEDULED_SITE

public static final Integer SCHEDULED_SITE
The site where the job is scheduled.


mAvgComputeTime

private float mAvgComputeTime
The average compute time for a node.


mDownwardRank

private float mDownwardRank
The downward rank for a node.


mUpwardRank

private float mUpwardRank
The upward rank for a node.


mStartTime

private long mStartTime
The estimated start time for a job.


mEndTime

private long mEndTime
The estimated end time for a job.


mScheduledSite

private String mScheduledSite
The site where a job is scheduled to run.

Constructor Detail

HeftBag

public HeftBag()
The default constructor.

Method Detail

add

public boolean add(Object key,
                   Object value)
Adds an object to the underlying bag corresponding to a particular key.

Specified by:
add in interface Bag
Parameters:
key - the key with which the value has to be associated.
value - the value to be associated with the key.
Returns:
boolean indicating if insertion was successful.

containsKey

public boolean containsKey(Object key)
Returns true if the namespace contains a mapping for the specified key.

Specified by:
containsKey in interface Bag
Parameters:
key - The key that you want to search for in the bag.
Returns:
boolean

get

public Object get(Object key)
Returns an objects corresponding to the key passed.

Specified by:
get in interface Bag
Parameters:
key - the key corresponding to which the objects need to be returned.
Returns:
the object that is found corresponding to the key or null.

getIntValue

private int getIntValue(Object key)
A convenience method to get the intValue for the object passed.

Parameters:
key - the key to be converted
Returns:
the int value if object an integer, else -1


Copyright © 2011 The University of Southern California. All Rights Reserved.