01: /**
02: * This file or a portion of this file is licensed under the terms of
03: * the Globus Toolkit Public License, found in file GTPL, or at
04: * http://www.globus.org/toolkit/download/license.html. This notice must
05: * appear in redistributions of this file, with or without modification.
06: *
07: * Redistributions of this Software, with or without modification, must
08: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
09: * some other similar material which is provided with the Software (if
10: * any).
11: *
12: * Copyright 1999-2004 University of Chicago and The University of
13: * Southern California. All rights reserved.
14: */package org.griphyn.cPlanner.cluster;
15:
16: import org.griphyn.cPlanner.classes.ADag;
17: import org.griphyn.cPlanner.classes.PegasusBag;
18:
19: import org.griphyn.cPlanner.partitioner.Partition;
20:
21: import java.util.List;
22:
23: /**
24: * The clustering API, that constructs clusters of jobs out of a single
25: * partition.
26: *
27: *
28: * @author Karan Vahi
29: * @version $Revision: 450 $
30: */
31:
32: public interface Clusterer {
33:
34: /**
35: * The version number associated with this API of Code Generator.
36: */
37: public static final String VERSION = "1.1";
38:
39: /**
40: *Initializes the Clusterer impelementation
41: *
42: * @param dag the workflow that is being clustered.
43: * @param bag the bag of objects that is useful for initialization.
44: *
45: * @throws ClustererException in case of error.
46: */
47: public void initialize(ADag dag, PegasusBag bag)
48: throws ClustererException;
49:
50: /**
51: * Determine the clusters for a partition.
52: *
53: * @param partition the partition for which the clusters need to be
54: * determined.
55: *
56: * @throws ClustererException in case of error.
57: */
58: public void determineClusters(Partition partition)
59: throws ClustererException;
60:
61: /**
62: * Associates the relations between the partitions with the corresponding
63: * relations between the clustered jobs that are created for each Partition.
64: *
65: * @param partitionID the id of a partition.
66: * @param parents the list of <code>String</code> objects that contain
67: * the id's of the parents of the partition.
68: *
69: * @throws ClustererException in case of error.
70: */
71: public void parents(String partitionID, List parents)
72: throws ClustererException;
73:
74: /**
75: * Returns the clustered workflow.
76: *
77: * @return the <code>ADag</code> object corresponding to the clustered workflow.
78: *
79: * @throws ClustererException in case of error.
80: */
81: public ADag getClusteredDAG() throws ClustererException;
82:
83: /**
84: * Returns a textual description of the transfer implementation.
85: *
86: * @return a short textual description
87: */
88: public String description();
89:
90: }
|