public abstract class Abstract extends Object implements Clusterer
Modifier and Type | Field and Description |
---|---|
protected Collection<PCRelation> |
mClusteredRelations
The collection of relations, that is constructed for the clustered
workflow.
|
protected JobAggregatorInstanceFactory |
mJobAggregatorFactory
The handle to the job aggregator factory.
|
protected LogManager |
mLogger
The handle to the logger object.
|
protected Map<String,Job> |
mPartitionClusterMap
A Map that indexes the partition ID to the clustered job.
|
protected PegasusProperties |
mProps
The handle to the properties object holding all the properties.
|
protected ADag |
mScheduledDAG
ADag object containing the jobs that have been scheduled by the site
selector.
|
protected Map<String,Job> |
mSubInfoMap
A Map to store all the job(Job) objects indexed by their logical ID found in
the dax.
|
Constructor and Description |
---|
Abstract()
The Abstract constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addJob(Job job)
Adds jobs to the internal map of jobs that is maintained by the clusterer.
|
protected void |
associate(Partition p,
Job job)
Maps the partition to the corresponding clustered job.
|
protected Job |
clusteredJob(Partition p)
Returns the job corresponding to a partition.
|
protected Job |
clusteredJob(String id)
Returns the job corresponding to a partition.
|
protected String |
constructClusteredJobID(Partition partition)
Returns the ID for the clustered job corresponding to a partition.
|
void |
determineClusters(Partition partition)
It creates a single clustered job for the partition.
|
abstract void |
determineInputOutputFiles(AggregatedJob job,
List<Job> orderedJobs)
Determine the input and output files of the job on the basis of the
order of the constituent jobs in the AggregatedJob.
|
ADag |
getClusteredDAG()
Returns the clustered workflow.
|
protected Job |
getJob(String id)
Returns the job object corresponding to the id of the job.
|
protected String |
getLogicalNameForJobs(List<Job> jobs)
Returns the logical names for the jobs.
|
void |
initialize(ADag dag,
PegasusBag bag)
Initializes the Clusterer impelementation
|
abstract List<String> |
order(Partition p)
Returns the nodes in the partition as a List in a particular order.
|
void |
parents(String partitionID,
List parents)
Associates the relations between the partitions with the corresponding
relations between the clustered jobs that are created for each Partition.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
description
protected Map<String,Job> mSubInfoMap
protected Map<String,Job> mPartitionClusterMap
protected LogManager mLogger
protected PegasusProperties mProps
protected JobAggregatorInstanceFactory mJobAggregatorFactory
protected Collection<PCRelation> mClusteredRelations
protected ADag mScheduledDAG
public abstract List<String> order(Partition p) throws ClustererException
p
- the partition whose nodes have to be ordered.String
objects that are the ID's
of the nodes.ClustererException
- in case of error.public abstract void determineInputOutputFiles(AggregatedJob job, List<Job> orderedJobs)
job
- the AggregatedJob
orderedJobs
- the List of Jobs that is ordered as determined by the clustererrClustererException
- in case of error.public void initialize(ADag dag, PegasusBag bag) throws ClustererException
initialize
in interface Clusterer
dag
- the workflow that is being clustered.bag
- the bag of objects that is useful for initialization.ClustererException
- in case of error.public void determineClusters(Partition partition) throws ClustererException
determineClusters
in interface Clusterer
partition
- the partition for which the clusters need to be
determined.ClustererException
- if the clustering executable is not installed
on the remote site or if all the jobs in the partition are not
scheduled on the same site.protected String getLogicalNameForJobs(List<Job> jobs)
jobs
- List of jobspublic void parents(String partitionID, List parents) throws ClustererException
parents
in interface Clusterer
partitionID
- the id of a partition.parents
- the list of String
objects that contain
the id's of the parents of the partition.ClustererException
- in case of clustered job not being found for a partition.public ADag getClusteredDAG() throws ClustererException
getClusteredDAG
in interface Clusterer
ADag
object corresponding to the clustered workflow.ClustererException
- in case of error.protected String constructClusteredJobID(Partition partition)
partition
- the partition.protected void addJob(Job job)
job
- the job being addedprotected Job getJob(String id)
id
- the id of the jobprotected void associate(Partition p, Job job)
p
- the partition being clustered.job
- the corresponding clustered job.protected Job clusteredJob(Partition p)
p
- the partition for which the clustered job is reqd.