Class DefaultQueueResourceRoundingStrategy
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.DefaultQueueResourceRoundingStrategy
- All Implemented Interfaces:
QueueResourceRoundingStrategy
public class DefaultQueueResourceRoundingStrategy
extends Object
implements QueueResourceRoundingStrategy
The default rounding strategy for resource calculation. Uses floor for all types except WEIGHT,
which is always the last type to consider, therefore it is safe to round up.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultQueueResourceRoundingStrategy(QueueCapacityVector.ResourceUnitCapacityType[] capacityTypePrecedence) -
Method Summary
Modifier and TypeMethodDescriptiondoublegetRoundedResource(double resourceValue, QueueCapacityVector.QueueCapacityVectorEntry capacityVectorEntry) Returns a whole number converted from the calculated resource value.
-
Constructor Details
-
DefaultQueueResourceRoundingStrategy
public DefaultQueueResourceRoundingStrategy(QueueCapacityVector.ResourceUnitCapacityType[] capacityTypePrecedence)
-
-
Method Details
-
getRoundedResource
public double getRoundedResource(double resourceValue, QueueCapacityVector.QueueCapacityVectorEntry capacityVectorEntry) Description copied from interface:QueueResourceRoundingStrategyReturns a whole number converted from the calculated resource value.- Specified by:
getRoundedResourcein interfaceQueueResourceRoundingStrategy- Parameters:
resourceValue- calculated resource valuecapacityVectorEntry- configured capacity entry- Returns:
- rounded resource value
-