public class ResourceCalculationDriver extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,ResourceVector> |
batchRemainingResourcePerLabel |
protected Map<QueueCapacityVector.ResourceUnitCapacityType,AbstractQueueCapacityCalculator> |
calculators |
protected Collection<String> |
definedResources |
protected Map<String,ResourceVector> |
normalizedResourceRatioPerLabel |
protected Map<String,ResourceVector> |
overallRemainingResourcePerLabel |
protected CSQueue |
queue |
protected QueueResourceRoundingStrategy |
roundingStrategy |
protected Map<String,Map<String,Double>> |
sumWeightsPerLabel |
protected QueueCapacityUpdateContext |
updateContext |
protected Map<String,Double> |
usedResourceByCurrentCalculatorPerLabel |
Constructor and Description |
---|
ResourceCalculationDriver(CSQueue queue,
QueueCapacityUpdateContext updateContext,
Map<QueueCapacityVector.ResourceUnitCapacityType,AbstractQueueCapacityCalculator> calculators,
Collection<String> definedResources) |
Modifier and Type | Method and Description |
---|---|
void |
calculateResources()
Calculates and sets the minimum and maximum effective resources for all children under the
parent queue with which this driver was initialized.
|
ResourceVector |
getBatchRemainingResource(String label)
Returns the remaining resources of a parent that is still available for its
children.
|
Collection<CSQueue> |
getChildQueues()
Returns all the children defined under the driver parent queue.
|
Map<String,ResourceVector> |
getNormalizedResourceRatios()
Returns the ratio of the summary of children absolute configured resources and the parent's
effective minimum resource.
|
double |
getParentAbsoluteMaxCapacity(String label,
String resourceName)
Returns the ratio of the parent queue's effective maximum resource relative to the full cluster
resource.
|
double |
getParentAbsoluteMinCapacity(String label,
String resourceName)
Returns the ratio of the parent queue's effective minimum resource relative to the full cluster
resource.
|
CSQueue |
getQueue()
Returns the parent that is driving the calculation.
|
double |
getRemainingRatioOfResource(String label,
String resourceName)
Returns the remaining resource ratio under the parent queue.
|
double |
getSumWeightsByResource(String label,
String resourceName)
Returns the aggregated children weights.
|
QueueCapacityUpdateContext |
getUpdateContext()
Returns the context that is used throughout the whole update phase.
|
void |
incrementWeight(String label,
String resourceName,
double value)
Increments the aggregated weight.
|
protected final QueueResourceRoundingStrategy roundingStrategy
protected final CSQueue queue
protected final QueueCapacityUpdateContext updateContext
protected final Map<QueueCapacityVector.ResourceUnitCapacityType,AbstractQueueCapacityCalculator> calculators
protected final Collection<String> definedResources
protected final Map<String,ResourceVector> overallRemainingResourcePerLabel
protected final Map<String,ResourceVector> batchRemainingResourcePerLabel
protected final Map<String,ResourceVector> normalizedResourceRatioPerLabel
public ResourceCalculationDriver(CSQueue queue, QueueCapacityUpdateContext updateContext, Map<QueueCapacityVector.ResourceUnitCapacityType,AbstractQueueCapacityCalculator> calculators, Collection<String> definedResources)
public CSQueue getQueue()
public Collection<CSQueue> getChildQueues()
public QueueCapacityUpdateContext getUpdateContext()
public void incrementWeight(String label, String resourceName, double value)
label
- node labelresourceName
- resource unit namevalue
- weight valuepublic double getSumWeightsByResource(String label, String resourceName)
label
- node labelresourceName
- resource unit namepublic Map<String,ResourceVector> getNormalizedResourceRatios()
public double getRemainingRatioOfResource(String label, String resourceName)
label
- node labelresourceName
- name of resource unitpublic double getParentAbsoluteMinCapacity(String label, String resourceName)
label
- node labelresourceName
- name of resource unitpublic double getParentAbsoluteMaxCapacity(String label, String resourceName)
label
- node labelresourceName
- name of resource unitpublic ResourceVector getBatchRemainingResource(String label)
label
- node labelpublic void calculateResources()
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.