Package org.jppf.load.balancer
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 Summary
FieldsModifier and TypeFieldDescriptionprotected intThe current bundle size.protected JPPFSystemInformationHolds information about the node's environment and configuration.protected JPPFDistributedJobHolds information about the current job being dispatched.protected intThe number of processing threads in the node.Fields inherited from class org.jppf.load.balancer.AbstractBundler
bundlerNumber, profile, timestampFields inherited from interface org.jppf.load.balancer.Bundler
BUNDLER_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAdaptiveBundler(T profile) Creates a new instance with the specified parameters profile. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Release the resources used by this bundler.voidfeedback(int size, double totalTime, double accumulatedElapsed, double overheadTime) Feedback the bundler with the result of using the bundle with the specified size.intGet the current bundle size.Get the corresponding node's system information.getJob()Get the current job for which load-balancing is being performed.intmaxSize()Get the max bundle size that can be used for this bundler.voidsetChannelConfiguration(JPPFSystemInformation nodeConfiguration) Set the corresponding node's system information.voidsetJob(JPPFDistributedJob job) Set the current job for which load-balancing is being performed.Methods inherited from class org.jppf.load.balancer.AbstractBundler
feedback, 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
feedback, getProfile, getTimestamp, setup
-
Field Details
-
bundleSize
protected int bundleSizeThe current bundle size. -
channelConfiguration
Holds information about the node's environment and configuration. -
nbThreads
protected int nbThreadsThe number of processing threads in the node. -
job
Holds information about the current job being dispatched.
-
-
Constructor Details
-
AbstractAdaptiveBundler
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:BundlerGet the current bundle size.- Specified by:
getBundleSizein interfaceBundler<T extends LoadBalancingProfile>- Returns:
- the bundle size as an int value.
-
getChannelConfiguration
Description copied from interface:ChannelAwarenessGet the corresponding node's system information.- Specified by:
getChannelConfigurationin interfaceChannelAwareness- Returns:
- a
JPPFSystemInformationinstance.
-
setChannelConfiguration
Description copied from interface:ChannelAwarenessSet the corresponding node's system information.- Specified by:
setChannelConfigurationin interfaceChannelAwareness- Parameters:
nodeConfiguration- aJPPFSystemInformationinstance.
-
feedback
public void feedback(int size, double totalTime, double accumulatedElapsed, double overheadTime) Description copied from interface:BundlerExFeedback 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:
feedbackin interfaceBundlerEx<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
Description copied from interface:JobAwarenessGet the current job for which load-balancing is being performed.- Specified by:
getJobin interfaceJobAwareness- Returns:
- a
JPPFDistributedJobinstance.
-
setJob
Description copied from interface:JobAwarenessSet 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:
setJobin interfaceJobAwareness- Parameters:
job- aJPPFDistributedJobinstance.
-
dispose
public void dispose()Description copied from class:AbstractBundlerRelease the resources used by this bundler.- Specified by:
disposein interfaceBundler<T extends LoadBalancingProfile>- Overrides:
disposein classAbstractBundler<T extends LoadBalancingProfile>
-
maxSize
public int maxSize()Get the max bundle size that can be used for this bundler.- Overrides:
maxSizein classAbstractBundler<T extends LoadBalancingProfile>- Returns:
- the bundle size as an int.
-