tassl.application.workflow
Class PolicyAbstract

java.lang.Object
  extended by tassl.application.workflow.PolicyAbstract
Direct Known Subclasses:
Budget, Deadline, MinRun

public abstract class PolicyAbstract
extends java.lang.Object


Field Summary
protected  java.util.List<java.lang.String> AgentList
           
protected  java.util.HashMap<java.lang.String,Resource> globalResources
           
protected  java.util.HashMap<java.lang.Integer,WorkerForScheduler> MapTask
           
 
Constructor Summary
PolicyAbstract()
           
PolicyAbstract(java.util.HashMap globalResources, java.util.List AgentList, java.util.List AgentToAgentNetworkPush, java.util.List AgentToAgentNetworkPull, java.util.List AgentToMachine)
           
 
Method Summary
protected  double[] calculateInputTransfer(java.util.List<java.lang.Integer> originFiles, java.util.List<FileProperties> inputFiles, int siteIndex)
          Calculate information about transferring input files to the siteIndex site.
 double[] calculateOutputTransfer(java.util.List<java.lang.Integer> destinationFiles, java.util.List<FileProperties> outputFiles, int siteIndex)
           
protected  boolean checkInputConstraints(java.util.List<FileProperties> inputFiles, int siteIndex)
          Check if all input files of a task can be moved to the site under consideration
protected  java.util.List<java.lang.Integer> getDestinationFiles(java.util.List<FileProperties> outputFiles)
           
 java.util.HashMap<java.lang.Integer,WorkerForScheduler> getMapTask()
           
protected  java.util.List<java.lang.Integer> getOriginFiles(java.util.List<FileProperties> inputFiles)
           
 void initialize(java.util.HashMap globalResources, java.util.List AgentList, java.util.List AgentToAgentNetworkPush, java.util.List AgentToAgentNetworkPull, java.util.List AgentToMachine)
           
abstract  java.util.HashMap scheduleStage(java.lang.String wkflId, WorkflowStage stage, java.util.HashMap<java.lang.String,java.util.List<WorkerForScheduler>> globalSlots)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MapTask

protected java.util.HashMap<java.lang.Integer,WorkerForScheduler> MapTask

globalResources

protected java.util.HashMap<java.lang.String,Resource> globalResources

AgentList

protected java.util.List<java.lang.String> AgentList
Constructor Detail

PolicyAbstract

public PolicyAbstract()

PolicyAbstract

public PolicyAbstract(java.util.HashMap globalResources,
                      java.util.List AgentList,
                      java.util.List AgentToAgentNetworkPush,
                      java.util.List AgentToAgentNetworkPull,
                      java.util.List AgentToMachine)
Method Detail

initialize

public final void initialize(java.util.HashMap globalResources,
                             java.util.List AgentList,
                             java.util.List AgentToAgentNetworkPush,
                             java.util.List AgentToAgentNetworkPull,
                             java.util.List AgentToMachine)

getMapTask

public java.util.HashMap<java.lang.Integer,WorkerForScheduler> getMapTask()

getOriginFiles

protected java.util.List<java.lang.Integer> getOriginFiles(java.util.List<FileProperties> inputFiles)

getDestinationFiles

protected java.util.List<java.lang.Integer> getDestinationFiles(java.util.List<FileProperties> outputFiles)

checkInputConstraints

protected boolean checkInputConstraints(java.util.List<FileProperties> inputFiles,
                                        int siteIndex)
Check if all input files of a task can be moved to the site under consideration

Parameters:
inputFiles - files to transfer
siteIndex - destination
Returns:
boolean

calculateInputTransfer

protected double[] calculateInputTransfer(java.util.List<java.lang.Integer> originFiles,
                                          java.util.List<FileProperties> inputFiles,
                                          int siteIndex)
Calculate information about transferring input files to the siteIndex site.

Parameters:
originFiles -
inputFiles -
siteIndex -
Returns:
[time to transfer, costInData, costOutData]

calculateOutputTransfer

public double[] calculateOutputTransfer(java.util.List<java.lang.Integer> destinationFiles,
                                        java.util.List<FileProperties> outputFiles,
                                        int siteIndex)
Parameters:
destinationFiles -
outputFiles -
siteIndex -
Returns:
[time to transfer, costInData, costOutData]

scheduleStage

public abstract java.util.HashMap scheduleStage(java.lang.String wkflId,
                                                WorkflowStage stage,
                                                java.util.HashMap<java.lang.String,java.util.List<WorkerForScheduler>> globalSlots)
Parameters:
wkflId -
stage -
globalSlots - available scheduling slots (workers)
Returns:
mapTasks. It will be empty if something failed