org.jppf.server.scheduler.bundle.proportional
Class AbstractProportionalBundler

java.lang.Object
  extended by org.jppf.server.scheduler.bundle.AbstractBundler
      extended by org.jppf.server.scheduler.bundle.proportional.AbstractProportionalBundler
All Implemented Interfaces:
Bundler
Direct Known Subclasses:
ClientProportionalBundler, NodeSimulator.SimulatedProportionalBundler, ProportionalBundler

public abstract class AbstractProportionalBundler
extends AbstractBundler

This bundler implementation computes bundle sizes propertional to the mean execution time for each node to the power of n, where n is an integer value specified in the configuration file as "proportionality factor".
The scope of this bundler is all nodes, which means that it computes the size for all nodes, unless an override is specified by the nodes.
The mean execution time is computed as a moving average over a number of tasks, specified in the bundling algorithm profile configuration as "performanceCacheSize"
This algorithm is well suited for relatively small networks (a few dozen nodes at most). It generates an overhead everytime the performance data for a node is updated. In the case of a small network, this overhead is not large enough to impact the overall performance significantly.

Author:
Laurent Cohen

Field Summary
protected  int bundleSize
          The current bundle size.
protected  BundleDataHolder dataHolder
          Bounded memory of the past performance updates.
 
Fields inherited from class org.jppf.server.scheduler.bundle.AbstractBundler
bundlerNumber, profile, timestamp
 
Constructor Summary
AbstractProportionalBundler(LoadBalancingProfile profile)
          Creates a new instance with the initial size of bundle as the start size.
 
Method Summary
 void dispose()
          Release the resources used by this bundler.
 void feedback(int size, double time)
          This method delegates the bundle size calculation to the singleton instance of SimpleBundler.
 int getBundleSize()
          Get the current size of bundle.
 BundleDataHolder getDataHolder()
          Get the bounded memory of the past performance updates.
 double normalize(double x)
           
 void setBundleSize(int size)
          Set the current size of bundle.
 void setup()
          Perform context-independant initializations.
 
Methods inherited from class org.jppf.server.scheduler.bundle.AbstractBundler
getBundlerNumber, getProfile, getTimestamp, maxSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jppf.server.scheduler.bundle.Bundler
copy
 

Field Detail

dataHolder

protected BundleDataHolder dataHolder
Bounded memory of the past performance updates.


bundleSize

protected int bundleSize
The current bundle size.

Constructor Detail

AbstractProportionalBundler

public AbstractProportionalBundler(LoadBalancingProfile profile)
Creates a new instance with the initial size of bundle as the start size.

Parameters:
profile - the parameters of the load-balancing algorithm,
Method Detail

getBundleSize

public int getBundleSize()
Get the current size of bundle.

Returns:
the bundle size as an int value.
See Also:
Bundler.getBundleSize()

setBundleSize

public void setBundleSize(int size)
Set the current size of bundle.

Parameters:
size - the bundle size as an int value.
See Also:
Bundler.getBundleSize()

feedback

public void feedback(int size,
                     double time)
This method delegates the bundle size calculation to the singleton instance of SimpleBundler.

Specified by:
feedback in interface Bundler
Overrides:
feedback in class AbstractBundler
Parameters:
size - the number of tasks executed.
time - the time in milliseconds it took to execute the tasks.
See Also:
AbstractBundler.feedback(int, double)

setup

public void setup()
Perform context-independant initializations.

Specified by:
setup in interface Bundler
Overrides:
setup in class AbstractBundler
See Also:
AbstractBundler.setup()

dispose

public void dispose()
Release the resources used by this bundler.

Specified by:
dispose in interface Bundler
Overrides:
dispose in class AbstractBundler
See Also:
AbstractBundler.dispose()

getDataHolder

public BundleDataHolder getDataHolder()
Get the bounded memory of the past performance updates.

Returns:
a BundleDataHolder instance.

normalize

public double normalize(double x)
Parameters:
x - .
Returns:
.


Copyright © 2005-2010 JPPF Team.