Source Code Cross Referenced for Vertical.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » cPlanner » cluster » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » pegasus 2.1.0 » org.griphyn.cPlanner.cluster 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * This file or a portion of this file is licensed under the terms of
003:         * the Globus Toolkit Public License, found in file GTPL, or at
004:         * http://www.globus.org/toolkit/download/license.html. This notice must
005:         * appear in redistributions of this file, with or without modification.
006:         *
007:         * Redistributions of this Software, with or without modification, must
008:         * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009:         * some other similar material which is provided with the Software (if
010:         * any).
011:         *
012:         * Copyright 1999-2004 University of Chicago and The University of
013:         * Southern California. All rights reserved.
014:         */package org.griphyn.cPlanner.cluster;
015:
016:        import org.griphyn.cPlanner.classes.SubInfo;
017:        import org.griphyn.cPlanner.classes.AggregatedJob;
018:        import org.griphyn.cPlanner.classes.PegasusFile;
019:
020:        import org.griphyn.cPlanner.partitioner.Topological;
021:        import org.griphyn.cPlanner.partitioner.Partition;
022:
023:        import java.util.List;
024:        import java.util.Set;
025:        import java.util.HashSet;
026:        import java.util.Iterator;
027:
028:        /**
029:         * The vertical cluster, that extends the Default clusterer and topologically
030:         * sorts the partition before clustering the jobs into aggregated jobs.
031:         *
032:         * @author Karan Vahi
033:         * @version $Revision: 50 $
034:         */
035:
036:        public class Vertical extends Abstract {
037:
038:            /**
039:             * A short description about the partitioner.
040:             */
041:            public static final String DESCRIPTION = "Topological based Vertical Clustering";
042:
043:            /**
044:             * The default constructor.
045:             */
046:            public Vertical() {
047:                super ();
048:            }
049:
050:            /**
051:             * Returns a textual description of the transfer implementation.
052:             *
053:             * @return a short textual description
054:             */
055:            public String description() {
056:                return this .DESCRIPTION;
057:            }
058:
059:            /**
060:             * Returns the nodes in the partition as a List in the topologically sorted
061:             * order.
062:             *
063:             * @param p  the partition whose nodes have to be ordered.
064:             *
065:             * @return an ordered List of <code>String</code> objects that are the ID's
066:             *         of the nodes.
067:             *
068:             * @throws ClustererException in case of error.
069:             */
070:            public List order(Partition p) throws ClustererException {
071:                try {
072:                    return new Topological(p).sort();
073:                } catch (Exception e) {
074:                    throw new ClustererException(
075:                            "Unable to sort the partition " + p.getID(), e);
076:                }
077:            }
078:
079:            /**
080:             * Determine the input and output files of the job on the basis of the
081:             * order of the constituent jobs in the AggregatedJob.
082:             * The input and output files are determined on the basis of topologically
083:             * sorted order of the constituent jobs.
084:             *
085:             * @param job  the <code>AggregatedJob</code>
086:             *
087:             * @throws ClustererException in case of error.
088:             */
089:            public void determineInputOutputFiles(AggregatedJob job) {
090:
091:                //set the input files to null for time being
092:                job.inputFiles = null;
093:                job.outputFiles = null;
094:
095:                Set inputFiles = new HashSet();
096:                Set materializedFiles = new HashSet();
097:
098:                PegasusFile file;
099:
100:                //the constituent jobs are topologically sorted
101:                //traverse through them and build up the ip and op files
102:                for (Iterator it = job.constituentJobsIterator(); it.hasNext();) {
103:                    SubInfo cjob = (SubInfo) it.next();
104:
105:                    //traverse through input files of constituent job
106:                    for (Iterator fileIt = cjob.getInputFiles().iterator(); fileIt
107:                            .hasNext();) {
108:                        file = (PegasusFile) fileIt.next();
109:                        //add to input files if it has not been materializd
110:                        if (!materializedFiles.contains(file)) {
111:                            inputFiles.add(file);
112:                        }
113:                    }
114:
115:                    //traverse through output files of constituent job
116:                    for (Iterator fileIt = cjob.getOutputFiles().iterator(); fileIt
117:                            .hasNext();) {
118:                        file = (PegasusFile) fileIt.next();
119:                        //add to materialized files
120:                        materializedFiles.add(file);
121:
122:                        //                //file is output only if it has to be registered or transferred
123:                        //                if ( !file.getTransientRegFlag() ||
124:                        //                     file.getTransferFlag() != PegasusFile.TRANSFER_NOT ){
125:                        //                    outputFiles.add( file );
126:                        //                }
127:                    }
128:                }
129:
130:                job.setInputFiles(inputFiles);
131:
132:                //all the materialized files are output files for
133:                //the aggregated job.
134:                job.setOutputFiles(materializedFiles);
135:
136:            }
137:
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.