tassl.application.cometcloud.sample
Class GenerateTasks

java.lang.Object
  extended by tassl.application.cometcloud.GenerateTasksAbstract
      extended by tassl.application.cometcloud.sample.GenerateTasks

public class GenerateTasks
extends GenerateTasksAbstract

This code is a simple map/reduce application. The map is going to generate PR tasks per file found in the input directories. The reduce will get all results and perform an operation. Note: no binaries are needed, just dummy files and the computation is emulated using the sleep function.


Constructor Summary
GenerateTasks()
           
 
Method Summary
 GenerateTasksObject createTasks(java.lang.String stageId, java.util.List<FileProperties> input, FileProperties output, java.lang.String propertyFileValues, java.util.List dependencies, java.lang.String method)
          Create Tasks for the specified stage of the workflow.
static void main(java.lang.String[] args)
           
 GenerateTasksObject map(java.util.List<FileProperties> input, FileProperties output, java.lang.String propertyFile)
           
 GenerateTasksObject reduce(java.util.List<FileProperties> input, FileProperties output, java.lang.String propertyFile, java.util.HashMap<java.lang.String,FileProperties> previousResults)
           
 
Methods inherited from class tassl.application.cometcloud.GenerateTasksAbstract
addRelatedWorkflowResults, executeSsh, generatePreviousResultFiles, generatePreviousResultFilesStageId, getPreviousResults, getProperty, getProperty, getRelatedWorkflowsResults, loadProperties, setPreviousResults, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenerateTasks

public GenerateTasks()
Method Detail

createTasks

public GenerateTasksObject createTasks(java.lang.String stageId,
                                       java.util.List<FileProperties> input,
                                       FileProperties output,
                                       java.lang.String propertyFileValues,
                                       java.util.List dependencies,
                                       java.lang.String method)
Description copied from class: GenerateTasksAbstract
Create Tasks for the specified stage of the workflow.

Specified by:
createTasks in class GenerateTasksAbstract
input - list of input FileProperties, which include URI (address:/dir/path/) where you can find input files, and constraints. Correspond to InputData in the input xml
output - a FileProperties object, which includes URI (address:/dir/path/) that should be placed in the task to know where to upload the results. Correspond to Results in the input xml.
propertyFileValues - Values of the propertyFile specified in the XML workflow description
dependencies - Previous stages. This can be use to get results values from those previous stages
Returns:
return an object with requirements and task parameters

map

public GenerateTasksObject map(java.util.List<FileProperties> input,
                               FileProperties output,
                               java.lang.String propertyFile)

reduce

public GenerateTasksObject reduce(java.util.List<FileProperties> input,
                                  FileProperties output,
                                  java.lang.String propertyFile,
                                  java.util.HashMap<java.lang.String,FileProperties> previousResults)

main

public static void main(java.lang.String[] args)