Class AutoTunedBundler

All Implemented Interfaces:
Bundler<AnnealingTuneProfile>, BundlerEx<AnnealingTuneProfile>, ChannelAwareness, ContextAwareness, JobAwareness, PersistentState

public class AutoTunedBundler extends AbstractAdaptiveBundler<AnnealingTuneProfile> implements PersistentState
This class implements a self tuned bundle size algorithm. It starts using the bundle size defined in property file and starts changing it to find a better performance. The algorithm starts making The algorithm waits for some execution to get a mean execution time, and them make a change in bundle size Each time the change is done, it is done over a smaller range randomly selected (like Monte Carlo algorithm).
Author:
Domingos Creado, Laurent Cohen
  • Constructor Details

    • AutoTunedBundler

      public AutoTunedBundler(AnnealingTuneProfile profile)
      Creates a new instance with the initial size of bundle as the start size.
      Parameters:
      profile - the parameters of the auto-tuning algorithm, grouped as a performance analysis profile.
  • Method Details

    • getBundleSize

      public int getBundleSize()
      Description copied from interface: Bundler
      Get the current bundle size.
      Specified by:
      getBundleSize in interface Bundler<AnnealingTuneProfile>
      Overrides:
      getBundleSize in class AbstractAdaptiveBundler<AnnealingTuneProfile>
      Returns:
      the bundle size as an int value.
    • dispose

      public void dispose()
      Description copied from class: AbstractBundler
      Release the resources used by this bundler.
      Specified by:
      dispose in interface Bundler<AnnealingTuneProfile>
      Overrides:
      dispose in class AbstractAdaptiveBundler<AnnealingTuneProfile>
    • feedback

      public void feedback(int bundleSize, double time)
      This method performs the actual bundle size computation, based on current and past performance data.
      Depending on the the performance samples and profile parameters, the following actions may be triggered in this method:
      • samples collection (unconditional)
      • detection of performance profile changes, if not currently being done
      • when a performance profile change is detected, recompute the bundle size.
      Specified by:
      feedback in interface Bundler<AnnealingTuneProfile>
      Overrides:
      feedback in class AbstractBundler<AnnealingTuneProfile>
      Parameters:
      bundleSize - bundle size of the new performance sample.
      time - total execution time of the new sample.
    • getState

      public Object getState()
      Description copied from interface: PersistentState
      Get this bundler's state.
      Specified by:
      getState in interface PersistentState
      Returns:
      an Object representing the state of the load-balancer.
    • setState

      public void setState(Object persistedState)
      Description copied from interface: PersistentState
      Set this bundler's state.
      Specified by:
      setState in interface PersistentState
      Parameters:
      persistedState - an Object representing the state of the load-balancer.
    • getStateLock

      public Lock getStateLock()
      Description copied from interface: PersistentState
      Get a lock that can be used to synchronize access to the load-balancer state. The main usage is to avoid race conditions when the state is serialized by the persistence thread, while it is being updated, in particular via its feedback() method, in another thread.
      Specified by:
      getStateLock in interface PersistentState
      Returns:
      a Lock object.