akka.cluster.routing
Class CapacityMetricsSelector

java.lang.Object
  extended by akka.cluster.routing.CapacityMetricsSelector
All Implemented Interfaces:
MetricsSelector, java.io.Serializable
Direct Known Subclasses:
CpuMetricsSelector, CpuMetricsSelector$, HeapMetricsSelector, HeapMetricsSelector$, MixMetricsSelectorBase, SystemLoadAverageMetricsSelector, SystemLoadAverageMetricsSelector$

public abstract class CapacityMetricsSelector
extends java.lang.Object
implements MetricsSelector

A MetricsSelector producing weights from remaining capacity. The weights are typically proportional to the remaining capacity.

See Also:
Serialized Form

Constructor Summary
CapacityMetricsSelector()
           
 
Method Summary
abstract  scala.collection.immutable.Map<Address,java.lang.Object> capacity(scala.collection.immutable.Set<NodeMetrics> nodeMetrics)
          Remaining capacity for each node.
 scala.collection.immutable.Map<Address,java.lang.Object> weights(scala.collection.immutable.Map<Address,java.lang.Object> capacity)
          Converts the capacity values to weights.
 scala.collection.immutable.Map<Address,java.lang.Object> weights(scala.collection.immutable.Set<NodeMetrics> nodeMetrics)
          The weights per address, based on the capacity produced by the nodeMetrics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapacityMetricsSelector

public CapacityMetricsSelector()
Method Detail

capacity

public abstract scala.collection.immutable.Map<Address,java.lang.Object> capacity(scala.collection.immutable.Set<NodeMetrics> nodeMetrics)
Remaining capacity for each node. The value is between 0.0 and 1.0, where 0.0 means no remaining capacity (full utilization) and 1.0 means full remaining capacity (zero utilization).


weights

public scala.collection.immutable.Map<Address,java.lang.Object> weights(scala.collection.immutable.Map<Address,java.lang.Object> capacity)
Converts the capacity values to weights. The node with lowest capacity gets weight 1 (lowest usable capacity is 1%) and other nodes gets weights proportional to their capacity compared to the node with lowest capacity.


weights

public scala.collection.immutable.Map<Address,java.lang.Object> weights(scala.collection.immutable.Set<NodeMetrics> nodeMetrics)
The weights per address, based on the capacity produced by the nodeMetrics.

Specified by:
weights in interface MetricsSelector