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