类 ResourceUnitRanking
java.lang.Object
org.apache.pulsar.policies.data.loadbalancer.ResourceUnitRanking
- 所有已实现的接口:
Comparable<ResourceUnitRanking>
The class containing information about system resources, allocated quota, and loaded bundles.
-
构造器概要
构造器构造器说明ResourceUnitRanking(SystemResourceUsage systemResourceUsage, Set<String> loadedBundles, ResourceQuota allocatedQuota, Set<String> preAllocatedBundles, ResourceQuota preAllocatedQuota) -
方法概要
修饰符和类型方法说明voidaddPreAllocatedServiceUnit(String suName, ResourceQuota quota) Pre-allocate a ServiceUnit to this ResourceUnit.static longcalculateBrokerMaxCapacity(SystemResourceUsage systemResourceUsage, ResourceQuota defaultQuota) Estimate the maximum number namespace bundles a ResourceUnit is able to handle with all resource.intCompare two loads based on message rate only.intcompareTo(ResourceUnitRanking other) longestimateMaxCapacity(ResourceQuota defaultQuota) Estimate the maximum number of namespace bundles ths ResourceUnit is able to handle with all resource.doublePercentage of inbound bandwidth allocated to bundle's quota.doublePercentage of outbound bandwidth allocated to bundle's quota.doublePercentage of CPU allocated to bundle's quota.doublePercetage of memory allocated to bundle's quota.doubleGet the estimated load percentage.Get the load percentage in String, with detail resource usages.doubleGet the estimated message rate.Get the loaded bundles.Get the pre-allocated bundles.booleanisIdle()If the ResourceUnit is idle.booleanisServiceUnitLoaded(String suName) Check if a ServiceUnit is already loaded by this ResourceUnit.booleanisServiceUnitPreAllocated(String suName) Check if a ServiceUnit is pre-allocated to this ResourceUnit.voidremoveLoadedServiceUnit(String suName, ResourceQuota quota) Remove a service unit from the loaded bundle list.static voidsetCpuUsageByMsgRate(double cpuUsageByMsgRate)
-
构造器详细资料
-
ResourceUnitRanking
public ResourceUnitRanking(SystemResourceUsage systemResourceUsage, Set<String> loadedBundles, ResourceQuota allocatedQuota, Set<String> preAllocatedBundles, ResourceQuota preAllocatedQuota)
-
-
方法详细资料
-
setCpuUsageByMsgRate
public static void setCpuUsageByMsgRate(double cpuUsageByMsgRate) -
compareTo
- 指定者:
compareTo在接口中Comparable<ResourceUnitRanking>
-
compareMessageRateTo
Compare two loads based on message rate only. -
isIdle
public boolean isIdle()If the ResourceUnit is idle. -
isServiceUnitLoaded
Check if a ServiceUnit is already loaded by this ResourceUnit. -
isServiceUnitPreAllocated
Check if a ServiceUnit is pre-allocated to this ResourceUnit. -
addPreAllocatedServiceUnit
Pre-allocate a ServiceUnit to this ResourceUnit. -
removeLoadedServiceUnit
Remove a service unit from the loaded bundle list. -
getPreAllocatedBundles
Get the pre-allocated bundles. -
getLoadedBundles
Get the loaded bundles. -
getEstimatedLoadPercentage
public double getEstimatedLoadPercentage()Get the estimated load percentage. -
getEstimatedMessageRate
public double getEstimatedMessageRate()Get the estimated message rate. -
getAllocatedLoadPercentageCPU
public double getAllocatedLoadPercentageCPU()Percentage of CPU allocated to bundle's quota. -
getAllocatedLoadPercentageMemory
public double getAllocatedLoadPercentageMemory()Percetage of memory allocated to bundle's quota. -
getAllocatedLoadPercentageBandwidthIn
public double getAllocatedLoadPercentageBandwidthIn()Percentage of inbound bandwidth allocated to bundle's quota. -
getAllocatedLoadPercentageBandwidthOut
public double getAllocatedLoadPercentageBandwidthOut()Percentage of outbound bandwidth allocated to bundle's quota. -
getEstimatedLoadPercentageString
Get the load percentage in String, with detail resource usages. -
estimateMaxCapacity
Estimate the maximum number of namespace bundles ths ResourceUnit is able to handle with all resource. -
calculateBrokerMaxCapacity
public static long calculateBrokerMaxCapacity(SystemResourceUsage systemResourceUsage, ResourceQuota defaultQuota) Estimate the maximum number namespace bundles a ResourceUnit is able to handle with all resource.
-