Class ObjectResourcesItem
- java.lang.Object
-
- org.apache.storm.scheduler.resource.strategies.scheduling.ObjectResourcesItem
-
public class ObjectResourcesItem extends Object
class to keep track of resources on a rack or node.
-
-
Field Summary
Fields Modifier and Type Field Description NormalizedResourceOffer
availableResources
double
avgResourcePercent
Amongst allavailableResources
, this is the average ratio of resource to the total available in group.String
id
double
minResourcePercent
Amongst allavailableResources
, this is the minimum ratio of resource to the total available in group.NormalizedResourceOffer
totalResources
-
Constructor Summary
Constructors Constructor Description ObjectResourcesItem(String id)
ObjectResourcesItem(String id, NormalizedResourceOffer availableResources, NormalizedResourceOffer totalResources, double minResourcePercent, double avgResourcePercent)
ObjectResourcesItem(ObjectResourcesItem other)
-
-
-
Field Detail
-
id
public final String id
-
availableResources
public NormalizedResourceOffer availableResources
-
totalResources
public NormalizedResourceOffer totalResources
-
minResourcePercent
public double minResourcePercent
Amongst allavailableResources
, 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
where value is calculated byObjectResourcesSummary.getAvailableResourcesOverall()
usingNormalizedResourceOffer.calculateMinPercentageUsedBy(NormalizedResourceOffer)
.
-
avgResourcePercent
public double avgResourcePercent
Amongst allavailableResources
, 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
where value is calculated byObjectResourcesSummary.getAvailableResourcesOverall()
usingNormalizedResourceOffer.calculateAveragePercentageUsedBy(NormalizedResourceOffer)
.
-
-
Constructor Detail
-
ObjectResourcesItem
public ObjectResourcesItem(String id)
-
ObjectResourcesItem
public ObjectResourcesItem(ObjectResourcesItem other)
-
ObjectResourcesItem
public ObjectResourcesItem(String id, NormalizedResourceOffer availableResources, NormalizedResourceOffer totalResources, double minResourcePercent, double avgResourcePercent)
-
-
Method Detail
-
add
public void add(ObjectResourcesItem other)
-
-