edu.isi.pegasus.planner.provisioner
Class Node

java.lang.Object
  extended by edu.isi.pegasus.planner.provisioner.Node

public class Node
extends Object

An instance of this class represents an independent task of a workflow. A task has PET(predicted execution time), list of input data sources(parent tasks), and list of output data(child tasks). This class also used for BTS algorithm such as EST, LFT, schdeuled start/finish time and core methods for BTS algorithm used by OccupationDiagram class.

Author:
Eunkyu Byun

Field Summary
private  HashSet ancestors
           
private  long ancET
           
 int cluster
           
private  Edge critEdge
           
static long DEFAULT_WEIGHT
           
private  HashSet descendants
           
private  long desET
           
private  long downLen
           
 boolean examined
           
private  String id
           
private  LinkedList inEdges
           
 long lb
           
 long olb
           
 long orb
           
private  LinkedList outEdges
           
 long rb
           
 long st
           
 boolean stacked
           
private  String taskName
           
 long tempFT
           
 long tempST
           
 long tlevel
           
private  long upLen
           
private  long weight
           
 
Constructor Summary
Node(String id)
           
Node(String id, String name, int n, long w)
           
Node(String id, String name, long w)
          constructor
 
Method Summary
 void addIn(Edge e)
          add a data dependency edge to this task
 void addOut(Edge e)
          add a data dependency edge from this task
 Set buildAncestors()
          build the list of ancestor tasks
 Set buildDescendants()
          build the list of descendant tasks
 boolean checkIn()
          check whether all parent tasks are finished.
 void checkIntegrity()
          check all child task's start time is scheduled after the finishtime of this task
 boolean equals(Object e)
           
 long evalWeight()
          return execution time of this task
 long getAncET()
           
 int getAncSize()
           
 long getDepET()
           
 int getDepSize()
           
 long getDesET()
           
 int getDesSize()
           
 long getDownLen()
          return the DnLength of this task.
 String getID()
           
 LinkedList getIn()
          return the list of incoming edges.
 LinkedList getOut()
          return the list of outgoing edges.
 long getUpLen()
          return the UpLength of this task.
 void init()
           
 void initOut(boolean s, long et)
          notify child nodes that this task will finish at time et
 boolean isAnc(Node n)
           
 boolean isBottom()
          Check whether this task is the exit task or not.
 boolean isDes(Node n)
           
 boolean isFree()
          used for DSC algorithm
 boolean isTop()
          Check whether this task is the entry task or not.
 boolean moveLeft(LinkedList[] timeMap, int limit, long bound)
          Redistribute this task to the earlier time.
 boolean moveRight(LinkedList[] timeMap, int limit, long bound)
          Redistribute this task to the later time.
 boolean NPbalance(LinkedList[] timeMap, int limit, boolean force)
          Non-propagate redistribution of this task
 void print()
           
private  int pushedChildren(long timeLimit)
           
private  int pushedParents(long timeLimit)
           
 void removeIn(Edge e)
          remove a specified data dependency edge from this task
 void removeOut(Edge e)
          remove a specified data dependency edge from this task
 void setWeight(long w)
          set execution time of this task
private  void updateDownLen()
           
 void updateLeftBound(long nlb, TreeSet set)
          update EST(earliest start time) of this task.
 void updateRightBound(long nrb, TreeSet set)
          update LFT(latest finish time) of this task.
private  void updateUpLen()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WEIGHT

public static final long DEFAULT_WEIGHT
See Also:
Constant Field Values

inEdges

private LinkedList inEdges

outEdges

private LinkedList outEdges

critEdge

private Edge critEdge

id

private String id

taskName

private String taskName

weight

private long weight

upLen

private long upLen

downLen

private long downLen

ancestors

private HashSet ancestors

descendants

private HashSet descendants

st

public long st

stacked

public boolean stacked

lb

public long lb

rb

public long rb

olb

public long olb

orb

public long orb

tempST

public long tempST

tempFT

public long tempFT

ancET

private long ancET

desET

private long desET

cluster

public int cluster

tlevel

public long tlevel

examined

public boolean examined
Constructor Detail

Node

public Node(String id,
            String name,
            long w)
constructor

Parameters:
id - the unique ID of this task
name - task name(executable name)
w - predicted execution time

Node

public Node(String id,
            String name,
            int n,
            long w)

Node

public Node(String id)
Method Detail

init

public void init()

setWeight

public void setWeight(long w)
set execution time of this task

Parameters:
w - excution time

evalWeight

public long evalWeight()
return execution time of this task

Returns:
excution time

addIn

public void addIn(Edge e)
add a data dependency edge to this task

Parameters:
e - the edge to be added

removeIn

public void removeIn(Edge e)
remove a specified data dependency edge from this task

Parameters:
e - the edge to be removed

addOut

public void addOut(Edge e)
add a data dependency edge from this task

Parameters:
e - the edge to be added

removeOut

public void removeOut(Edge e)
remove a specified data dependency edge from this task

Parameters:
e - the edge to be removed

checkIn

public boolean checkIn()
check whether all parent tasks are finished.

Returns:
true if all parent tasks are finished.

getIn

public LinkedList getIn()
return the list of incoming edges.

Returns:
LinkedList of edges.

getOut

public LinkedList getOut()
return the list of outgoing edges.

Returns:
LinkedList of edges.

initOut

public void initOut(boolean s,
                    long et)
notify child nodes that this task will finish at time et

Parameters:
et - finish time

updateUpLen

private void updateUpLen()

getUpLen

public long getUpLen()
return the UpLength of this task. UpLength is the longest path from the entry task

Returns:
UpLength

updateDownLen

private void updateDownLen()

getDownLen

public long getDownLen()
return the DnLength of this task. DnLength is the longest path to the exit task

Returns:
DnLength

isTop

public boolean isTop()
Check whether this task is the entry task or not.

Returns:
true or false

isBottom

public boolean isBottom()
Check whether this task is the exit task or not.

Returns:
true or false

getID

public String getID()

updateLeftBound

public void updateLeftBound(long nlb,
                            TreeSet set)
update EST(earliest start time) of this task.

Parameters:
nlb - new EST
set - set of ancestor tasks

updateRightBound

public void updateRightBound(long nrb,
                             TreeSet set)
update LFT(latest finish time) of this task.

Parameters:
nrb - new LFT
set - set of descendant tasks

NPbalance

public boolean NPbalance(LinkedList[] timeMap,
                         int limit,
                         boolean force)
Non-propagate redistribution of this task

Parameters:
timeMap - List of scheduled tasks at each time slot. i.e., Occupation diagram itself
limit - maximum height of Occupation diagram. The result of redistribution should cause taller height of this limit.
force - Not used.
Returns:
true if this task is redistributed.

moveLeft

public boolean moveLeft(LinkedList[] timeMap,
                        int limit,
                        long bound)
Redistribute this task to the earlier time. This causes ancestor tasks to be redistributed too.

Parameters:
timeMap - List of scheduled tasks at each time slot. i.e., Occupation diagram itself
limit - maximum height of Occupation diagram. The result of redistribution should cause taller height of this limit.
bound - Earliest time this tasks can be scheduled.
Returns:
true if this task is redistributed.

moveRight

public boolean moveRight(LinkedList[] timeMap,
                         int limit,
                         long bound)
Redistribute this task to the later time. This causes descensant tasks to be redistributed too.

Parameters:
timeMap - List of scheduled tasks at each time slot. i.e., Occupation diagram itself
limit - maximum height of Occupation diagram. The result of redistribution should cause taller height of this limit.
bound - Lastest time this tasks can be scheduled.
Returns:
true if this task is redistributed.

pushedParents

private int pushedParents(long timeLimit)

pushedChildren

private int pushedChildren(long timeLimit)

checkIntegrity

public void checkIntegrity()
check all child task's start time is scheduled after the finishtime of this task


buildDescendants

public Set buildDescendants()
build the list of descendant tasks

Returns:
the list of descensant tasks

buildAncestors

public Set buildAncestors()
build the list of ancestor tasks

Returns:
the list of ancestor tasks

getDepSize

public int getDepSize()

getAncSize

public int getAncSize()

getDesSize

public int getDesSize()

getAncET

public long getAncET()
Returns:
the sum of execution time of all ancestor tasks

getDesET

public long getDesET()
Returns:
the sum of execution time of all descendant tasks

getDepET

public long getDepET()
Returns:
the sum of execution time of all dependent tasks

isAnc

public boolean isAnc(Node n)

isDes

public boolean isDes(Node n)

print

public void print()

isFree

public boolean isFree()
used for DSC algorithm


equals

public boolean equals(Object e)
Overrides:
equals in class Object


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