Package org.jppf.load.balancer.impl
Class AutoTunedBundler
java.lang.Object
org.jppf.load.balancer.AbstractBundler<T>
org.jppf.load.balancer.AbstractAdaptiveBundler<AnnealingTuneProfile>
org.jppf.load.balancer.impl.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
-
Field Summary
Fields inherited from class org.jppf.load.balancer.AbstractAdaptiveBundler
bundleSize, channelConfiguration, job, nbThreadsFields inherited from class org.jppf.load.balancer.AbstractBundler
bundlerNumber, profile, timestampFields inherited from interface org.jppf.load.balancer.Bundler
BUNDLER_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionAutoTunedBundler(AnnealingTuneProfile profile) Creates a new instance with the initial size of bundle as the start size. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Release the resources used by this bundler.voidfeedback(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.intGet the current bundle size.getState()Get this bundler's state.Get a lock that can be used to synchronize access to the load-balancer state.voidSet this bundler's state.Methods inherited from class org.jppf.load.balancer.AbstractAdaptiveBundler
feedback, getChannelConfiguration, getJob, maxSize, setChannelConfiguration, setJobMethods inherited from class org.jppf.load.balancer.AbstractBundler
getBundlerNumber, getJPPFContext, getProfile, getTimestamp, setJPPFContext, setupMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jppf.load.balancer.Bundler
getProfile, getTimestamp, setup
-
Constructor Details
-
AutoTunedBundler
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:BundlerGet the current bundle size.- Specified by:
getBundleSizein interfaceBundler<AnnealingTuneProfile>- Overrides:
getBundleSizein classAbstractAdaptiveBundler<AnnealingTuneProfile>- Returns:
- the bundle size as an int value.
-
dispose
public void dispose()Description copied from class:AbstractBundlerRelease the resources used by this bundler.- Specified by:
disposein interfaceBundler<AnnealingTuneProfile>- Overrides:
disposein classAbstractAdaptiveBundler<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:
feedbackin interfaceBundler<AnnealingTuneProfile>- Overrides:
feedbackin classAbstractBundler<AnnealingTuneProfile>- Parameters:
bundleSize- bundle size of the new performance sample.time- total execution time of the new sample.
-
getState
Description copied from interface:PersistentStateGet this bundler's state.- Specified by:
getStatein interfacePersistentState- Returns:
- an Object representing the state of the load-balancer.
-
setState
Description copied from interface:PersistentStateSet this bundler's state.- Specified by:
setStatein interfacePersistentState- Parameters:
persistedState- an Object representing the state of the load-balancer.
-
getStateLock
Description copied from interface:PersistentStateGet 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 itsfeedback()method, in another thread.- Specified by:
getStateLockin interfacePersistentState- Returns:
- a
Lockobject.
-