Class AdaptiveJobCountLoadProbe
- java.lang.Object
- 
- org.apache.ignite.spi.loadbalancing.adaptive.AdaptiveJobCountLoadProbe
 
- 
- All Implemented Interfaces:
- AdaptiveLoadProbe
 
 public class AdaptiveJobCountLoadProbe extends Object implements AdaptiveLoadProbe Implementation of node load probing based on active and waiting job count. Based onsetUseAverage(boolean)parameter, this implementation will either use average job count values or current (default is to use averages).The load of a node is simply calculated by adding active and waiting job counts. Below is an example of how CPU load probe would be configured in Ignite Spring configuration file: <property name="loadBalancingSpi"> <bean class="org.apache.ignite.spi.loadBalancing.adaptive.GridAdaptiveLoadBalancingSpi"> <property name="loadProbe"> <bean class="org.apache.ignite.spi.loadBalancing.adaptive.GridAdaptiveJobCountLoadProbe"> <property name="useAverage" value="true"/> </bean> </property> </bean> </property>
- 
- 
Constructor SummaryConstructors Constructor Description AdaptiveJobCountLoadProbe()Initializes active job probe.AdaptiveJobCountLoadProbe(boolean useAvg)Creates new active job prove specifying whether to use average job counts vs. current.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetLoad(ClusterNode node, int jobsSentSinceLastUpdate)Calculates load value for a given node.booleanisUseAverage()Gets flag indicating whether to use average job counts vs. current.voidsetUseAverage(boolean useAvg)Sets flag indicating whether to use average job counts vs. current.StringtoString()
 
- 
- 
- 
Constructor Detail- 
AdaptiveJobCountLoadProbepublic AdaptiveJobCountLoadProbe() Initializes active job probe.
 - 
AdaptiveJobCountLoadProbepublic AdaptiveJobCountLoadProbe(boolean useAvg) Creates new active job prove specifying whether to use average job counts vs. current.- Parameters:
- useAvg- Flag indicating whether to use average job counts vs. current.
 
 
- 
 - 
Method Detail- 
isUseAveragepublic boolean isUseAverage() Gets flag indicating whether to use average job counts vs. current.- Returns:
- Flag indicating whether to use average job counts vs. current.
 
 - 
setUseAveragepublic void setUseAverage(boolean useAvg) Sets flag indicating whether to use average job counts vs. current.- Parameters:
- useAvg- Flag indicating whether to use average job counts vs. current.
 
 - 
getLoadpublic double getLoad(ClusterNode node, int jobsSentSinceLastUpdate) Calculates load value for a given node. Specific implementations would usually take into account some of the values provided byClusterNode.metrics()method. For example, load can be calculated based on job execution time or number of active jobs, or CPU/Heap utilization.Note that if this method returns a value of 0, then implementation will assume that load value is simply not available and will try to calculate an average of load values for other nodes. If such average cannot be obtained (all node load values are0), then a value of1will be used.- Specified by:
- getLoadin interface- AdaptiveLoadProbe
- Parameters:
- node- Grid node to calculate load for.
- jobsSentSinceLastUpdate- Number of jobs sent to this node since last metrics update. This parameter may be useful when implementation takes into account the current job count on a node.
- Returns:
- Non-negative load value for the node (zero and above).
 
 
- 
 
-