edu.isi.pegasus.planner.selector.site

## Class RoundRobin

- java.lang.Object
- - edu.isi.pegasus.planner.selector.site.Abstract
  - - edu.isi.pegasus.planner.selector.site.AbstractPerJob
    - - edu.isi.pegasus.planner.selector.site.RoundRobin

All Implemented Interfaces:
  SiteSelector

    public class RoundRobin
    extends AbstractPerJob

This ends up scheduling the jobs in a round robin manner. In order to avoid starvation, the jobs are scheduled in a round robin manner per level, and the queue is initialised for each level.

Version:
  $Revision$
Author:
  Karan Vahi

### Nested Class Summary

Nested Classes
`(package private) class` `RoundRobin.NameValue` A inner name value class that associates a string with an int value.

### Field Summary

Fields
`private int` `mCurrentLevel` The current level in the abstract workflow.
`private java.util.LinkedList` `mExecPools` The list of pools that have been given by the user at run time or has been authenticated against.

### Fields inherited from class edu.isi.pegasus.planner.selector.site.Abstract

`mBag, mLogger, mProps, mSiteStore, mTCMapper`

### Fields inherited from interface edu.isi.pegasus.planner.selector.SiteSelector

`SITE_NOT_FOUND, VERSION`

### Constructor Summary

Constructors
Constructor and Description
`RoundRobin()` The default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String` `description()` Returns a brief description of the site selection techinque implemented by this class.
`private void` `initialiseList(java.util.List pools)` It initialises the internal list.
`void` `mapJob(Job job, java.util.List sites)` Maps a job in the workflow to an execution site.

### Methods inherited from class edu.isi.pegasus.planner.selector.site.AbstractPerJob

`mapWorkflow`

### Methods inherited from class edu.isi.pegasus.planner.selector.site.Abstract

`initialize`

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

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

### Field Detail

#### mCurrentLevel

    private int mCurrentLevel

The current level in the abstract workflow. It is level that is designated by Chimera while constructing the graph bottom up.

#### mExecPools

    private java.util.LinkedList mExecPools

The list of pools that have been given by the user at run time or has been authenticated against. At present these are the same as the list of pools that is passed for site selection at each function.

### Constructor Detail

#### RoundRobin

    public RoundRobin()

The default constructor. Not to be used.

### Method Detail

#### description

    public java.lang.String description()

Returns a brief description of the site selection techinque implemented by this class.

Returns:
  String

#### mapJob

    public void mapJob(Job job,
                       java.util.List sites)

Maps a job in the workflow to an execution site.

Specified by:
  `mapJob` in class `AbstractPerJob`
Parameters:
  `job` - the job to be mapped.
  `sites` - the list of `String` objects representing the execution sites that can be used.

#### initialiseList

    private void initialiseList(java.util.List pools)

It initialises the internal list. A node in the list corresponds to a pool that can be used, and has the value associated with it which is the number of jobs in the current level have been scheduled to it.

Parameters:
  `pools` - List