edu.isi.pegasus.planner.code.generator

## Class NetloggerJobMapper

- java.lang.Object
- - edu.isi.pegasus.planner.code.generator.NetloggerJobMapper

    public class NetloggerJobMapper
    extends java.lang.Object

This class can write out the job mappings that link jobs with jobs in the DAX to a Writer stream in the netlogger format.

Version:
  $Revision$
Author:
  Karan Vahi

### Field Summary

Fields
`private LogFormatter` `mLogFormatter` The handle to the netlogger log formatter.
`private LogManager` `mLogger` The handle to pegasus logger used for run.
`static java.lang.String` `NETLOGGER_LOG_FORMATTER_IMPLEMENTOR`

### Constructor Summary

Constructors
Constructor and Description
`NetloggerJobMapper(LogManager logger)` The default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`private java.lang.String` `generateLogEvent(Job job, java.lang.String prefix)` Generates a log event message in the netlogger format for a job
`private java.lang.String` `getKey(java.lang.String prefix, java.lang.String key)` Adds a prefix to the key and returns it.
`private int` `getTaskCount(Job job)` Returns the task count for a job.
`void` `writeOutMappings(java.io.Writer writer, ADag dag)` Writes out the job mappings for a workflow.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### NETLOGGER_LOG_FORMATTER_IMPLEMENTOR

    public static final java.lang.String NETLOGGER_LOG_FORMATTER_IMPLEMENTOR

See Also:
  Constant Field Values

#### mLogFormatter

    private LogFormatter mLogFormatter

The handle to the netlogger log formatter.

#### mLogger

    private LogManager mLogger

The handle to pegasus logger used for run.

### Constructor Detail

#### NetloggerJobMapper

    public NetloggerJobMapper(LogManager logger)

The default constructor.

Parameters:
  `logger` - the logger instance to use for logging

### Method Detail

#### writeOutMappings

    public void writeOutMappings(java.io.Writer writer,
                                 ADag dag)
                          throws java.io.IOException

Writes out the job mappings for a workflow.

Parameters:
  `writer` - the writer stream to which to write out the mappings
  `dag` - the dag for which to write out the mappings
Throws:
  `java.io.IOException`

#### generateLogEvent

    private java.lang.String generateLogEvent(Job job,
                                              java.lang.String prefix)

Generates a log event message in the netlogger format for a job

Parameters:
  `job` - the job
  `prefix` - prefix if any to add to the keys
Returns:
  netlogger formatted message

#### getKey

    private java.lang.String getKey(java.lang.String prefix,
                                    java.lang.String key)

Adds a prefix to the key and returns it.

Parameters:
  `prefix` - the prefix to be added
  `key` - the key
Returns:
  the key with prefix added.

#### getTaskCount

    private int getTaskCount(Job job)

Returns the task count for a job. The task count is the number of jobs associated with the job in the DAX

Parameters:
  `job` -
Returns:
  task count