edu.isi.pegasus.planner.partitioner

## Class Label

- java.lang.Object
- - edu.isi.pegasus.planner.partitioner.Partitioner
  - - edu.isi.pegasus.planner.partitioner.Label

    public class Label
    extends Partitioner

This partitioner partitions the DAX into smaller partitions as specified by the labels associated with the jobs. If no label is specified, then the partitioner puts the job into a unique partition corresponding to the job ID.

Version:
  $Revision$
Author:
  Karan Vahi

### Field Summary

Fields
`static java.lang.String` `DESCRIPTION` A short description about the partitioner.
`private LogManager` `mLogger` The handle to the Logging object.
`private java.util.Map` `mPartitionMap` A map indexed by the label.
`private java.util.LinkedList` `mQueue` The first in first out queue, that manages the set of gray vertices in a breadth first search.

### Fields inherited from class edu.isi.pegasus.planner.partitioner.Partitioner

`mGraph, mProps, mRoot, PACKAGE_NAME, VERSION`

### Constructor Summary

Constructors
Constructor and Description
`Label(GraphNode root, java.util.Map graph, PegasusProperties properties)` The overloaded constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String` `description()` Returns a textual description of the transfer implementation.
`void` `determinePartitions(Callback c)` Partitions the graph passed in the constructor, on the basis of the labels associated with the nodes in the graph.
`private java.lang.String` `getLabel(GraphNode node)` Returns the label for the node.
`private java.lang.String` `getPartitionID(int id)` Constructs the id for the partition.

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

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

### Field Detail

#### DESCRIPTION

    public static final java.lang.String DESCRIPTION

A short description about the partitioner.

See Also:
  Constant Field Values

#### mPartitionMap

    private java.util.Map mPartitionMap

A map indexed by the label. Each value is a partition object consisting of jobs with that label.

#### mQueue

    private java.util.LinkedList mQueue

The first in first out queue, that manages the set of gray vertices in a breadth first search.

#### mLogger

    private LogManager mLogger

The handle to the Logging object.

### Constructor Detail

#### Label

    public Label(GraphNode root,
                 java.util.Map graph,
                 PegasusProperties properties)

The overloaded constructor.

Parameters:
  `root` - the dummy root node of the graph.
  `graph` - the map containing all the nodes of the graph keyed by the logical id of the nodes.
  `properties` - the properties passed to the planner.

### Method Detail

#### determinePartitions

    public void determinePartitions(Callback c)

Partitions the graph passed in the constructor, on the basis of the labels associated with the nodes in the graph. All the nodes, with the same label are deemed to be in the same partition.

Specified by:
  `determinePartitions` in class `Partitioner`
Parameters:
  `c` - the callback for the partitioner.

#### description

    public java.lang.String description()

Returns a textual description of the transfer implementation.

Specified by:
  `description` in class `Partitioner`
Returns:
  a short textual description

#### getLabel

    private java.lang.String getLabel(GraphNode node)

Returns the label for the node. If no label is associated with the node, then the ID of the node is assumed as the label.

Parameters:
  `node` - the node for which the label is required.
Returns:
  the label associated with the job, else the id of the node.

#### getPartitionID

    private java.lang.String getPartitionID(int id)

Constructs the id for the partition.

Parameters:
  `id` - the integer id.
Returns:
  the ID of the partition.