@Override public void handleResponse(AbstractResponse abstractResponse) { MetadataResponse response = (MetadataResponse) abstractResponse; long now = time.milliseconds(); metadataManager.update(response.cluster(), now); // Unassign all unsent requests after a metadata refresh to allow for a new // destination to be selected from the new metadata unassignUnsentCalls(node -> true); }
Cluster cluster = response.cluster();
MetadataResponse response = (MetadataResponse) abstractResponse; Cluster cluster = response.cluster(); Map<String, Errors> errors = response.errors(); for (Map.Entry<String, KafkaFutureImpl<TopicDescription>> entry : topicFutures.entrySet()) {
Cluster cluster = response.cluster();
partitionNumByTopic.put(topicName2, 1); MetadataResponse updateMetadataResponse = TestUtils.metadataUpdateWith(2, partitionNumByTopic); Cluster updatedCluster = updateMetadataResponse.cluster();
private void handleMetadataResponse(RequestHeader header, Struct body, long now) { this.metadataFetchInProgress = false; MetadataResponse response = new MetadataResponse(body); Cluster cluster = response.cluster(); // don't update the cluster if there are no valid nodes...the topic we want may still be in the process of being // created which means we will get errors and no nodes until it exists if (cluster.nodes().size() > 0) { this.metadata.update(cluster, now); } else { log.trace("Ignoring empty metadata response with correlation id {}.", header.correlationId()); this.metadata.failedUpdate(now); } }