public class Cell extends Object
Constructor and Description |
---|
Cell(Integer id)
Constructor of the cell class using the given id to identify the cell.
|
Modifier and Type | Method and Description |
---|---|
void |
addBroker(Broker broker) |
Collection<Broker> |
aliveBrokers() |
Broker |
broker(int brokerId)
Get the broker with the given broker id.
|
Collection<Broker> |
brokers()
Get the collection of brokers in the current cell.
|
Capacity |
capacity()
Get capacity for the cell.
|
boolean |
containsBroker(int brokerId) |
Collection<Broker> |
eligibleBrokers() |
boolean |
equals(Object o) |
int |
hashCode() |
Integer |
id()
Get the cell Id.
|
boolean |
isCellAlive()
Checks if cell has at least one alive brokers.
|
boolean |
isCellEligible()
Checks if cell has at least one broker eligible for replica placement (alive & not-excluded).
|
Load |
load()
Get the cell load information.
|
int |
numReplicas()
Return total number of replicas in this cell.
|
long |
numTopicReplicas(String topic)
Get the number of replicas with the given topic name in this cell.
|
List<Replica> |
replicas()
Get the list of replicas in the cell.
|
Set<String> |
topics()
Get a set of topic names in the cell.
|
String |
toString() |
Utilization |
utilization() |
public Cell(Integer id)
id
- An identifier for this cell.public void addBroker(Broker broker)
public Capacity capacity()
public Load load()
public Utilization utilization()
public Integer id()
public Collection<Broker> brokers()
public Collection<Broker> aliveBrokers()
public Collection<Broker> eligibleBrokers()
public Broker broker(int brokerId)
brokerId
- Id of the queried broker.public boolean containsBroker(int brokerId)
public long numTopicReplicas(String topic)
topic
- Name of the topic for which the number of replicas in this cell will be counted.public int numReplicas()
public boolean isCellAlive()
public boolean isCellEligible()