public class ObjectResourcesItem extends Object
class to keep track of resources on a rack or node.
Modifier and Type | Field and Description |
---|---|
NormalizedResourceOffer |
availableResources |
double |
avgResourcePercent
Amongst all
availableResources , this is the average ratio of resource to the total available in group. |
String |
id |
double |
minResourcePercent
Amongst all
availableResources , this is the minimum ratio of resource to the total available in group. |
NormalizedResourceOffer |
totalResources |
Constructor and Description |
---|
ObjectResourcesItem(ObjectResourcesItem other) |
ObjectResourcesItem(String id) |
ObjectResourcesItem(String id,
NormalizedResourceOffer availableResources,
NormalizedResourceOffer totalResources,
double minResourcePercent,
double avgResourcePercent) |
public final String id
public NormalizedResourceOffer availableResources
public NormalizedResourceOffer totalResources
public double minResourcePercent
Amongst all availableResources
, this is the minimum ratio of resource to the total available in group. Note that nodes are grouped into hosts. Hosts into racks. And racks are grouped under the cluster.
An example of this calculation is in
NodeSorter#sortObjectResourcesCommon(ObjectResourcesSummary, ExecutorDetails, NodeSorter.ExistingScheduleFunc)
where value is calculated by ObjectResourcesSummary.getAvailableResourcesOverall()
using NormalizedResourceOffer.calculateMinPercentageUsedBy(NormalizedResourceOffer)
.
public double avgResourcePercent
Amongst all availableResources
, this is the average ratio of resource to the total available in group. Note that nodes are grouped into hosts, hosts into racks, and racks are grouped under the cluster.
An example of this calculation is in
NodeSorter#sortObjectResourcesCommon(ObjectResourcesSummary, ExecutorDetails, NodeSorter.ExistingScheduleFunc)
where value is calculated by ObjectResourcesSummary.getAvailableResourcesOverall()
using NormalizedResourceOffer.calculateAveragePercentageUsedBy(NormalizedResourceOffer)
.
public ObjectResourcesItem(String id)
public ObjectResourcesItem(ObjectResourcesItem other)
public ObjectResourcesItem(String id, NormalizedResourceOffer availableResources, NormalizedResourceOffer totalResources, double minResourcePercent, double avgResourcePercent)
public void add(ObjectResourcesItem other)
Copyright © 2022 The Apache Software Foundation. All rights reserved.