Package org.jppf.load.balancer.impl
Class NodeThreadsBundler
java.lang.Object
org.jppf.load.balancer.AbstractBundler<NodeThreadsProfile>
org.jppf.load.balancer.impl.NodeThreadsBundler
- All Implemented Interfaces:
Bundler<NodeThreadsProfile>,ChannelAwareness,ContextAwareness
public class NodeThreadsBundler
extends AbstractBundler<NodeThreadsProfile>
implements ChannelAwareness
This implementation of a load-balancing algorithm illustrates the use of
the
ChannelAwareness APIs, by sending to each node at most m * n tasks,
where n is the number of processing threads in the node, and m is a
user-defined parameter which defaults to one.- Author:
- Laurent Cohen
-
Field Summary
Fields inherited from class org.jppf.load.balancer.AbstractBundler
bundlerNumber, profile, timestampFields inherited from interface org.jppf.load.balancer.Bundler
BUNDLER_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionNodeThreadsBundler(NodeThreadsProfile profile) Creates a new instance with the specified parameters profile. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Release the resources used by this bundler.intGet the current number of tasks to send to the node.Get the corresponding node's system information.voidsetChannelConfiguration(JPPFSystemInformation channelConfiguration) Set the corresponding node's system information.Methods inherited from class org.jppf.load.balancer.AbstractBundler
feedback, getBundlerNumber, getJPPFContext, getProfile, getTimestamp, maxSize, setJPPFContext, setup
-
Constructor Details
-
NodeThreadsBundler
Creates a new instance with the specified parameters profile.- Parameters:
profile- the parameters of the load-balancing algorithm.
-
-
Method Details
-
getBundleSize
public int getBundleSize()Get the current number of tasks to send to the node.- Specified by:
getBundleSizein interfaceBundler<NodeThreadsProfile>- 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:
channelConfiguration- aJPPFSystemInformationinstance.
-
dispose
public void dispose()Release the resources used by this bundler.- Specified by:
disposein interfaceBundler<NodeThreadsProfile>- Overrides:
disposein classAbstractBundler<NodeThreadsProfile>
-