public class ResourceUnitRanking extends Object implements Comparable<ResourceUnitRanking>
| Constructor and Description |
|---|
ResourceUnitRanking(SystemResourceUsage systemResourceUsage,
Set<String> loadedBundles,
ResourceQuota allocatedQuota,
Set<String> preAllocatedBundles,
ResourceQuota preAllocatedQuota) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPreAllocatedServiceUnit(String suName,
ResourceQuota quota)
Pre-allocate a ServiceUnit to this ResourceUnit.
|
static long |
calculateBrokerMaxCapacity(SystemResourceUsage systemResourceUsage,
ResourceQuota defaultQuota)
Estimate the maximum number namespace bundles a ResourceUnit is able to handle with all resource.
|
int |
compareMessageRateTo(ResourceUnitRanking other)
Compare two loads based on message rate only.
|
int |
compareTo(ResourceUnitRanking other) |
long |
estimateMaxCapacity(ResourceQuota defaultQuota)
Estimate the maximum number of namespace bundles ths ResourceUnit is able to handle with all resource.
|
double |
getAllocatedLoadPercentageBandwidthIn()
Percentage of inbound bandwidth allocated to bundle's quota.
|
double |
getAllocatedLoadPercentageBandwidthOut()
Percentage of outbound bandwidth allocated to bundle's quota.
|
double |
getAllocatedLoadPercentageCPU()
Percentage of CPU allocated to bundle's quota.
|
double |
getAllocatedLoadPercentageMemory()
Percetage of memory allocated to bundle's quota.
|
double |
getEstimatedLoadPercentage()
Get the estimated load percentage.
|
String |
getEstimatedLoadPercentageString()
Get the load percentage in String, with detail resource usages.
|
double |
getEstimatedMessageRate()
Get the estimated message rate.
|
Set<String> |
getLoadedBundles()
Get the loaded bundles.
|
Set<String> |
getPreAllocatedBundles()
Get the pre-allocated bundles.
|
boolean |
isIdle()
If the ResourceUnit is idle.
|
boolean |
isServiceUnitLoaded(String suName)
Check if a ServiceUnit is already loaded by this ResourceUnit.
|
boolean |
isServiceUnitPreAllocated(String suName)
Check if a ServiceUnit is pre-allocated to this ResourceUnit.
|
void |
removeLoadedServiceUnit(String suName,
ResourceQuota quota)
Remove a service unit from the loaded bundle list.
|
static void |
setCpuUsageByMsgRate(double cpuUsageByMsgRate) |
public ResourceUnitRanking(SystemResourceUsage systemResourceUsage, Set<String> loadedBundles, ResourceQuota allocatedQuota, Set<String> preAllocatedBundles, ResourceQuota preAllocatedQuota)
public static void setCpuUsageByMsgRate(double cpuUsageByMsgRate)
public int compareTo(ResourceUnitRanking other)
compareTo in interface Comparable<ResourceUnitRanking>public int compareMessageRateTo(ResourceUnitRanking other)
public boolean isIdle()
public boolean isServiceUnitLoaded(String suName)
public boolean isServiceUnitPreAllocated(String suName)
public void addPreAllocatedServiceUnit(String suName, ResourceQuota quota)
public void removeLoadedServiceUnit(String suName, ResourceQuota quota)
public double getEstimatedLoadPercentage()
public double getEstimatedMessageRate()
public double getAllocatedLoadPercentageCPU()
public double getAllocatedLoadPercentageMemory()
public double getAllocatedLoadPercentageBandwidthIn()
public double getAllocatedLoadPercentageBandwidthOut()
public String getEstimatedLoadPercentageString()
public long estimateMaxCapacity(ResourceQuota defaultQuota)
public static long calculateBrokerMaxCapacity(SystemResourceUsage systemResourceUsage, ResourceQuota defaultQuota)
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.