public class InPlace extends Object implements CleanupStrategy
Modifier and Type | Field and Description |
---|---|
static String |
CLEANUP_JOB_PREFIX
The prefix for CLEANUP_JOB ID i.e prefix+the parent compute_job ID becomes
ID of the cleanup job.
|
private HashSet |
mDoNotClean
HashSet of Files that should not be cleaned up
|
private CleanupImplementation |
mImpl
The handle to the CleanupImplementation instance that creates the jobs for us.
|
private LogManager |
mLogger
The handle to the logging object used for logging.
|
private int |
mMaxDepth
The max depth of any job in the workflow useful for a priorityQueue
implementation in an array
|
private PegasusProperties |
mProps
The handle to the properties passed to Pegasus.
|
private HashMap |
mResMap
The mapping to siteHandle to all the jobs that are mapped to it
mapping to siteHandle(String) to Set
|
private HashMap |
mResMapLeaves
The mapping of siteHandle to all subset of the jobs mapped to it that are
leaves in the workflow mapping to siteHandle(String) to Set
|
private HashMap |
mResMapRoots
The mapping of siteHandle to all subset of the jobs mapped to it that are
leaves in the workflow mapping to siteHandle(String) to Set
|
VERSION
Constructor and Description |
---|
InPlace()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
Graph |
addCleanupJobs(Graph workflow)
Adds cleanup jobs to the workflow.
|
private void |
addCleanUpJobs(String site,
Set leaves,
Graph workflow)
Adds cleanup jobs for the workflow scheduled to a particular site
a best first search strategy is implemented based on the depth of the job
in the workflow
|
protected void |
applyJobPriorities(Graph workflow)
Adds job priorities to the jobs in the workflow on the basis of
the levels in the traversal order given by the iterator.
|
protected String |
generateCleanupID(Job job)
Returns the identifier that is to be assigned to cleanup job.
|
protected String |
getSiteForCleanup(Job job)
Returns site to be used for the cleanup algorithm.
|
void |
initialize(PegasusBag bag,
CleanupImplementation impl)
Intializes the class.
|
protected void |
reset()
Resets the internal data structures.
|
private void |
setDepth_ResMap(List roots)
A BFS implementation to set depth value (roots have depth 1) and also
to populate mResMap ,mResMapLeaves,mResMapRoots which contains all the
jobs that are assigned to a particular resource
|
protected boolean |
typeNeedsCleanUp(int type)
Checks to see which job types are required to be looked at for cleanup.
|
protected boolean |
typeStageOut(int type)
Checks to see if job type is a stageout job type.
|
public static final String CLEANUP_JOB_PREFIX
private HashMap mResMap
private HashMap mResMapLeaves
private HashMap mResMapRoots
private int mMaxDepth
private HashSet mDoNotClean
private CleanupImplementation mImpl
private PegasusProperties mProps
private LogManager mLogger
public void initialize(PegasusBag bag, CleanupImplementation impl)
initialize
in interface CleanupStrategy
bag
- bag of initialization objectsimpl
- the implementation instance that creates cleanup jobpublic Graph addCleanupJobs(Graph workflow)
addCleanupJobs
in interface CleanupStrategy
workflow
- the workflow to add cleanup jobs to.protected void reset()
private void setDepth_ResMap(List roots)
roots
- List of GraphNode objects that are rootsprivate void addCleanUpJobs(String site, Set leaves, Graph workflow)
site
- the site IDleaves
- the leaf jobs that are scheduled to siteworkflow
- the Graph into which new cleanup jobs can be addedprotected void applyJobPriorities(Graph workflow)
workflow
- the workflow on which to apply job priorities.protected String generateCleanupID(Job job)
job
- the job with which the cleanup job is primarily associated.protected boolean typeNeedsCleanUp(int type)
type
- the type of the job.protected boolean typeStageOut(int type)
type
- the type of the job.Copyright © 2011 The University of Southern California. All Rights Reserved.