public class BrokerCapacityResolver extends java.lang.Object implements BrokerCapacityConfigResolver
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CAPACITY_BROKER_ID |
static java.lang.String |
LOG_DIRS_CONFIG |
Constructor and Description |
---|
BrokerCapacityResolver() |
Modifier and Type | Method and Description |
---|---|
BrokerCapacityInfo |
capacityForBroker(java.lang.String rack,
java.lang.String host,
int brokerId)
Get the capacity of a broker based on rack, host and broker id.
|
void |
close() |
void |
configure(java.util.Map<java.lang.String,?> configs)
Configure this class with the given key-value pairs
|
void |
updateDiskCapacityForBroker(java.lang.String rack,
java.lang.String host,
int brokerId,
double updateDiskCapacityInMiB)
Update the disk capacity for a broker based on rack, host and broker id.
|
public static final int DEFAULT_CAPACITY_BROKER_ID
public static final java.lang.String LOG_DIRS_CONFIG
public BrokerCapacityInfo capacityForBroker(java.lang.String rack, java.lang.String host, int brokerId)
BrokerCapacityConfigResolver
Resource
. The units for each resource are:
DISK - MegaBytes
CPU - Percentage (0 - 100)
Network Inbound - KB/s
Network Outbounds - KB/s
The response also contains the number of CPU cores and may contain disk capacities by logDirs (i.e. for JBOD).
May estimate the capacity of a broker, if it is not directly available.capacityForBroker
in interface BrokerCapacityConfigResolver
rack
- The rack of the brokerhost
- The host of the brokerbrokerId
- the id of the brokerpublic void configure(java.util.Map<java.lang.String,?> configs)
CruiseControlConfigurable
configure
in interface CruiseControlConfigurable
public void updateDiskCapacityForBroker(java.lang.String rack, java.lang.String host, int brokerId, double updateDiskCapacityInMiB)
BrokerCapacityConfigResolver
updateDiskCapacityForBroker
in interface BrokerCapacityConfigResolver
public void close()
close
in interface java.lang.AutoCloseable