Java Doc for NonJavaCallout.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » cPlanner » selector » site » 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.selector.site 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.griphyn.cPlanner.selector.site.Abstract
      org.griphyn.cPlanner.selector.site.AbstractPerJob
         org.griphyn.cPlanner.selector.site.NonJavaCallout

NonJavaCallout
public class NonJavaCallout extends AbstractPerJob (Code)
This is the class that implements a call-out to a site selector which is an application or executable script. In order to use the site selector implemented by this class, the property pegasus.selector.site must be set to value NonJavaCallout.

This site selector implements a popen() like call to an external application that conforms to the API laid out here. The name of the application to run is specified by the property pegasus.selector.site.path. Its value points to a locally available application.

If the external executable requires certain environment variables to be set for execution, these can be specified in the property files, using the prefix pegasus.selector.site.env. The name of the environment variable is obtained by stripping the prefix. For example, to set the variable PATH to a certain value, use the following entry in your user property file:

 pegasus.selector.site.env.PATH = /usr/bin:/bin:/usr/X11R6/bin
 
The site selector populates the environment of the external application with the following default properties, which can be overwritten by user-specified properties:

keyvalue
PEGASUS_HOME As set by the system
CLASSPATH From java.class.path
JAVA_HOME From java.home
USER From user.name, if present
LOGNAME From user.name, if present
HOME From user.home, if present
TMP From java.io.tmpdir, if present
TZ From user.timezone, if present

The user can specify the environment variables, by specifying the properties with the prefix pegasus.selector.site.env. prefix. for e.g user can override the default user.name property by setting the property pegasus.selector.site.env.user.home .

The external application is invoked with one commandline argument. This argument is the name of a temporary file. The temporary file is created for each invocation anew by the site selecting caller. Being temporary, the file is deleted after the site selector returns with success. The deletion of the file is governed by the property pegasus.selector.site.keep.tmp. It can have a tristate value with the valid values being

 ALWAYS
 NEVER
 ONERROR
 

The external application is expected to write one line to stdout. The line starts with the string SOLUTION:, followed by the chosen site handle. Optionally, separated by a colon, the name of a jobmanager for the site can be provided by the site selector. Two examples for successful site selections are:

 SOLUTION:mysite:my.job.mgr/jobmanager-batch
 SOLUTION:siteY
 
Note, these are two examples. The site selector only returns one line with the appropriate solution. If no site is found to be eligble, the poolhandle should be set to NONE by the site selector.

The temporary file is the corner stone of the communication between the site selecting caller and the external site selector. It is a collection of key-value pairs. Each pair is separated by an equals (=) sign, and stands on a line of its own. There are no multi-line values permitted.

The following pairs are generated for the siteselector temporary file:

#keyvalue
1version The version of the site selector API, currently 2.0
1transformation The fully-qualified definition identifier for the TR, ns::id:vs.
1derivation The fully-qualified definition identifier for the DV, ns::id:vs.
1job.level The job's depth in the DFS tree of the workflow DAG
1job.id The job's ID, as used in the DAX file.
Nresource.id A pool handle, followed by a whitespace, followed by a gridftp server. Typically, each gridftp server is enumerated once, so you may have multiple occurances of the same site.
Minput.lfn An input LFN, optionally followed by a whitespace and filesize.
1wf.name The label of the DAX, as found in the DAX's root element.
1wf.index The DAX index, which is incremented for each partition.
1wf.time The mtime of the workflow.
1wf.manager The name of the workflow manager to be used, e.g. dagman.
1vo.name unused at present, name of the virtual organization who runs this WF.
1vo.group unused at present, usage not clear .

In order to detect malfunctioning site selectors, a timeout is attached with each site selector, see property pegasus.selector.site.timeout. By default, a site selector is given up upon after 60 s.


author:
   Karan Vahi
author:
   Jens Vöckler
version:
   $Revision: 298 $
See Also:   java.lang.Runtime
See Also:   java.lang.Process



Field Summary
final public static  intKEEP_ALWAYS
     The state denoting always to keep the temporary files.
final public static  intKEEP_NEVER
     The state denoting never to keep the temporary files.
final public static  intKEEP_ONERROR
     The state denoting to keep the temporary files only in case of error.
final public static  StringPREFIX_PROPERTIES
     The prefix of the property names that specify the environment variables that need to be set before calling out to the site selector.
final public static  StringPREFIX_TEMPORARY_FILE
     The prefix to be used while creating a temporary file to pass to the external siteselector.
final public static  StringSOLUTION_PREFIX
     The prefix that the site selector writes out on its stdout to designate that it is sending a solution.
final public static  StringSUFFIX_TEMPORARY_FILE
     The suffix to be used while creating a temporary file to pass to the external siteselector.
final public static  StringVERSION
     The version number associated with this API of non java callout site selection.

Constructor Summary
public  NonJavaCallout()
     The default constructor.

Method Summary
public  Stringdescription()
     Returns a brief description of the site selection technique implemented by this class.
public  voidinitialize(PegasusBag bag)
     Initializes the site selector.
public static  voidmain(String[] args)
     The main program that allows you to test.
public  voidmapJob(SubInfo job, List sites)
     Calls out to the external site selector.
public  voidmapWorkflow(ADag workflow, List sites)
     Maps the jobs in the workflow to the various grid sites.

Field Detail
KEEP_ALWAYS
final public static int KEEP_ALWAYS(Code)
The state denoting always to keep the temporary files.



KEEP_NEVER
final public static int KEEP_NEVER(Code)
The state denoting never to keep the temporary files.



KEEP_ONERROR
final public static int KEEP_ONERROR(Code)
The state denoting to keep the temporary files only in case of error.



PREFIX_PROPERTIES
final public static String PREFIX_PROPERTIES(Code)
The prefix of the property names that specify the environment variables that need to be set before calling out to the site selector.



PREFIX_TEMPORARY_FILE
final public static String PREFIX_TEMPORARY_FILE(Code)
The prefix to be used while creating a temporary file to pass to the external siteselector.



SOLUTION_PREFIX
final public static String SOLUTION_PREFIX(Code)
The prefix that the site selector writes out on its stdout to designate that it is sending a solution.



SUFFIX_TEMPORARY_FILE
final public static String SUFFIX_TEMPORARY_FILE(Code)
The suffix to be used while creating a temporary file to pass to the external siteselector.



VERSION
final public static String VERSION(Code)
The version number associated with this API of non java callout site selection.




Constructor Detail
NonJavaCallout
public NonJavaCallout()(Code)
The default constructor.




Method Detail
description
public String description()(Code)
Returns a brief description of the site selection technique implemented by this class. a self-description of this site selector.



initialize
public void initialize(PegasusBag bag)(Code)
Initializes the site selector.
Parameters:
  bag - the bag of objects that is useful for initialization.



main
public static void main(String[] args)(Code)
The main program that allows you to test. FIXME: Test programs should have prefix Test.....java
Parameters:
  args - the arguments



mapJob
public void mapJob(SubInfo job, List sites)(Code)
Calls out to the external site selector. The method converts a SubInfo object into an API-compliant temporary file. The file's name is provided as single commandline argument to the site selector executable when it is invoked. The executable, representing the external site selector, provides its answer on stdout. The answer is captures, and returned.
Parameters:
  job - is a representation of the DAX compute job whose site ofexecution need to be determined.
Parameters:
  sites - the list of String objects representing theexecution sites that can be used.FIXME: Some site selector return an empty string on failures. Also:NONE could be a valid site name.
See Also:   org.griphyn.cPlanner.classes.SubInfo



mapWorkflow
public void mapWorkflow(ADag workflow, List sites)(Code)
Maps the jobs in the workflow to the various grid sites. The jobs are mapped by setting the site handle for the jobs.
Parameters:
  workflow - the workflow.
Parameters:
  sites - the list of String objects representing theexecution sites that can be used.



Methods inherited from org.griphyn.cPlanner.selector.site.AbstractPerJob
abstract public void mapJob(SubInfo job, List sites)(Code)(Java Doc)
public void mapWorkflow(Graph workflow, List sites)(Code)(Java Doc)

Fields inherited from org.griphyn.cPlanner.selector.site.Abstract
protected PegasusBag mBag(Code)(Java Doc)
protected LogManager mLogger(Code)(Java Doc)
protected PegasusProperties mProps(Code)(Java Doc)
protected PoolInfoProvider mSCHandle(Code)(Java Doc)
protected Mapper mTCMapper(Code)(Java Doc)

Methods inherited from org.griphyn.cPlanner.selector.site.Abstract
public void initialize(PegasusBag bag)(Code)(Java Doc)
public void mapWorkflow(ADag workflow, List sites)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.