Class AbstractAdaptiveBundler<T extends LoadBalancingProfile>

java.lang.Object
org.jppf.load.balancer.AbstractBundler<T>
org.jppf.load.balancer.AbstractAdaptiveBundler<T>
Type Parameters:
T - the type of parameters profile used by this bundler.
All Implemented Interfaces:
Bundler<T>, BundlerEx<T>, ChannelAwareness, ContextAwareness, JobAwareness
Direct Known Subclasses:
AutoTunedBundler, ProportionalBundler, RL2Bundler

public abstract class AbstractAdaptiveBundler<T extends LoadBalancingProfile> extends AbstractBundler<T> implements BundlerEx<T>, ChannelAwareness, JobAwareness
Author:
Laurent Cohen
  • Field Details

    • bundleSize

      protected int bundleSize
      The current bundle size.
    • channelConfiguration

      protected JPPFSystemInformation channelConfiguration
      Holds information about the node's environment and configuration.
    • nbThreads

      protected int nbThreads
      The number of processing threads in the node.
    • job

      protected JPPFDistributedJob job
      Holds information about the current job being dispatched.
  • Constructor Details

    • AbstractAdaptiveBundler

      public AbstractAdaptiveBundler(T profile)
      Creates a new instance with the specified parameters profile.
      Parameters:
      profile - the parameters of the load-balancing algorithm.
  • Method Details

    • getBundleSize

      public int getBundleSize()
      Description copied from interface: Bundler
      Get the current bundle size.
      Specified by:
      getBundleSize in interface Bundler<T extends LoadBalancingProfile>
      Returns:
      the bundle size as an int value.
    • getChannelConfiguration

      public JPPFSystemInformation getChannelConfiguration()
      Description copied from interface: ChannelAwareness
      Get the corresponding node's system information.
      Specified by:
      getChannelConfiguration in interface ChannelAwareness
      Returns:
      a JPPFSystemInformation instance.
    • setChannelConfiguration

      public void setChannelConfiguration(JPPFSystemInformation nodeConfiguration)
      Description copied from interface: ChannelAwareness
      Set the corresponding node's system information.
      Specified by:
      setChannelConfiguration in interface ChannelAwareness
      Parameters:
      nodeConfiguration - a JPPFSystemInformation instance.
    • feedback

      public void feedback(int size, double totalTime, double accumulatedElapsed, double overheadTime)
      Description copied from interface: BundlerEx
      Feedback the bundler with the result of using the bundle with the specified size. The feedback data consists in providing a number of tasks that were executed, and their total execution time in milliseconds. The execution time includes the network round trip between node and server.
      Specified by:
      feedback in interface BundlerEx<T extends LoadBalancingProfile>
      Parameters:
      size - number of tasks that were executed.
      totalTime - the total execution and transport time in nanoseconds.
      accumulatedElapsed - the total accumalated elapsed time (in the node) in nanoseconds for the execution of the tasks.
      overheadTime - the transport time in nanoseconds.
    • getJob

      public JPPFDistributedJob getJob()
      Description copied from interface: JobAwareness
      Get the current job for which load-balancing is being performed.
      Specified by:
      getJob in interface JobAwareness
      Returns:
      a JPPFDistributedJob instance.
    • setJob

      public void setJob(JPPFDistributedJob job)
      Description copied from interface: JobAwareness
      Set the current job for which load-balancing is being performed. This method should never be called directly, as it is set automatically be the JPPF load balancing framework.
      Specified by:
      setJob in interface JobAwareness
      Parameters:
      job - a JPPFDistributedJob instance.
    • dispose

      public void dispose()
      Description copied from class: AbstractBundler
      Release the resources used by this bundler.
      Specified by:
      dispose in interface Bundler<T extends LoadBalancingProfile>
      Overrides:
      dispose in class AbstractBundler<T extends LoadBalancingProfile>
    • maxSize

      public int maxSize()
      Get the max bundle size that can be used for this bundler.
      Overrides:
      maxSize in class AbstractBundler<T extends LoadBalancingProfile>
      Returns:
      the bundle size as an int.