public class Rack extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
Broker |
broker(int brokerId)
Get the broker with the given broker id.
|
Collection<Broker> |
brokers()
Get the collection of brokers in the current rack.
|
double |
capacityFor(Resource resource)
Get rack capacity for the requested resource.
|
Map<String,Object> |
getJsonStructure() |
Collection<Host> |
hosts()
Return the hosts in this rack.
|
String |
id()
Get the rack Id.
|
boolean |
isRackAlive()
Checks if rack has at least one alive servers.
|
Load |
load()
Get the rack load information.
|
int |
numTopicReplicas(String topic)
Get the number of replicas with the given topic name in this rack.
|
List<Replica> |
replicas()
Get the list of replicas in the rack.
|
Set<String> |
topics()
Get a set of topic names in the cluster.
|
String |
toString()
Get string representation of
Rack . |
void |
writeTo(OutputStream out)
Output writing string representation of this class to the stream.
|
public Load load()
public String id()
public Collection<Broker> brokers()
public Collection<Host> hosts()
public Broker broker(int brokerId)
brokerId
- Id of the queried broker.public int numTopicReplicas(String topic)
topic
- Name of the topic for which the number of replicas in this rack will be counted.public double capacityFor(Resource resource)
resource
- Resource for which capacity will be provided.public boolean isRackAlive()
public void writeTo(OutputStream out) throws IOException
out
- the output stream.IOException