broker.set(PORT, node.port()); broker.setIfExists(RACK, node.rack()); brokerArray.add(broker);
/** * Get information about brokers within the cluster. */ public NodeList getClusterNodes() { final List<NodeDetails> nodeDetails = new ArrayList<>(); try { final Collection<Node> nodes = adminClient.describeCluster().nodes().get(); for (final Node node: nodes) { nodeDetails.add(new NodeDetails(node.id(), node.host(), node.port(), node.rack())); } return new NodeList(nodeDetails); } catch (InterruptedException | ExecutionException e) { // TODO Handle throw new RuntimeException(e.getMessage(), e); } }
public static Node from(org.apache.kafka.common.Node node) { return new Node(node.hasRack(), node.host(), node.id(), node.idString(), node.isEmpty(), node.port(), node.rack()); }
value.coordinator().host(), value.coordinator().port(), value.coordinator().rack() );