Package org.jppf.load.balancer.impl
Class ProportionalBundler
java.lang.Object
org.jppf.load.balancer.AbstractBundler<T>
org.jppf.load.balancer.AbstractAdaptiveBundler<ProportionalProfile>
org.jppf.load.balancer.impl.ProportionalBundler
- All Implemented Interfaces:
Bundler<ProportionalProfile>,BundlerEx<ProportionalProfile>,ChannelAwareness,ContextAwareness,JobAwareness,PersistentState
public class ProportionalBundler
extends AbstractAdaptiveBundler<ProportionalProfile>
implements PersistentState
This bundler implementation computes bundle sizes proportional 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.
The mean execution time is computed as a moving average over a number of tasks, specified in the bundling algorithm profile configuration as "minSamplesToAnalyse"
This algorithm is well suited for relatively small networks (a few dozen nodes at most). It generates an overhead every time 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.
The scope of this bundler is all nodes, which means that it computes the size for all nodes.
The mean execution time is computed as a moving average over a number of tasks, specified in the bundling algorithm profile configuration as "minSamplesToAnalyse"
This algorithm is well suited for relatively small networks (a few dozen nodes at most). It generates an overhead every time 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
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
ConstructorsConstructorDescriptionProportionalBundler(ProportionalProfile 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 size, double time) This method delegates the bundle size calculation to the singleton instance ofSimpleBundler.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.voidsetBundleSize(int size) Set the current size of bundle.voidSet this bundler's state.voidsetup()Perform context-independent initializations.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, setJPPFContextMethods 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
-
Constructor Details
-
ProportionalBundler
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<ProportionalProfile>- Overrides:
getBundleSizein classAbstractAdaptiveBundler<ProportionalProfile>- Returns:
- the bundle size as an int value.
-
setBundleSize
public void setBundleSize(int size) Set the current size of bundle.- Parameters:
size- the bundle size as an int value.
-
feedback
public void feedback(int size, double time) This method delegates the bundle size calculation to the singleton instance ofSimpleBundler.- Specified by:
feedbackin interfaceBundler<ProportionalProfile>- Overrides:
feedbackin classAbstractBundler<ProportionalProfile>- Parameters:
size- the number of tasks executed.time- the time in nanoseconds it took to execute the tasks.
-
setup
public void setup()Perform context-independent initializations.- Specified by:
setupin interfaceBundler<ProportionalProfile>- Overrides:
setupin classAbstractBundler<ProportionalProfile>
-
dispose
public void dispose()Release the resources used by this bundler.- Specified by:
disposein interfaceBundler<ProportionalProfile>- Overrides:
disposein classAbstractAdaptiveBundler<ProportionalProfile>
-
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:
o- 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.
-