public interface ConnectionFactory
| Modifier and Type | Method and Description |
|---|---|
Connection |
connect(BrokerAddress brokerAddress)
Create a connection to a Kafka broker, caching it internally
|
void |
disconnect(BrokerAddress brokerAddress)
Close the connection to the broker
|
BrokerAddress |
getLeader(Partition partition)
Return the leader for a single partition
|
java.util.Map<Partition,BrokerAddress> |
getLeaders(java.lang.Iterable<Partition> partitions)
Retrieve the leaders for a set of partitions.
|
java.util.Collection<Partition> |
getPartitions(java.lang.String topic)
Retrieves the partitions of a given topic
|
void |
refreshMetadata(java.util.Collection<java.lang.String> topics)
Refresh the cached metadata (i.e.
|
Connection connect(BrokerAddress brokerAddress)
brokerAddress - a broker addressvoid disconnect(BrokerAddress brokerAddress)
brokerAddress - brokerAddressjava.util.Map<Partition,BrokerAddress> getLeaders(java.lang.Iterable<Partition> partitions)
partitions - whose leaders are queriedBrokerAddress getLeader(Partition partition)
partition - the partition whose leader is queriedvoid refreshMetadata(java.util.Collection<java.lang.String> topics)
topics - the topics for which to refresh the leadersjava.util.Collection<Partition> getPartitions(java.lang.String topic)
topic - the topic to query for