集群信息
This commit is contained in:
83
src/main/java/com/xuxd/kafka/console/beans/BrokerNode.java
Normal file
83
src/main/java/com/xuxd/kafka/console/beans/BrokerNode.java
Normal file
@@ -0,0 +1,83 @@
|
||||
package com.xuxd.kafka.console.beans;
|
||||
|
||||
import org.apache.kafka.common.Node;
|
||||
|
||||
/**
|
||||
* kafka-console-ui.
|
||||
*
|
||||
* @author xuxd
|
||||
* @date 2021-10-08 14:03:21
|
||||
**/
|
||||
public class BrokerNode {
|
||||
|
||||
private int id;
|
||||
|
||||
private String idString;
|
||||
|
||||
private String host;
|
||||
|
||||
private int port;
|
||||
|
||||
private String rack;
|
||||
|
||||
private boolean isController;
|
||||
|
||||
public static BrokerNode fromNode(Node node) {
|
||||
BrokerNode brokerNode = new BrokerNode();
|
||||
brokerNode.setId(node.id());
|
||||
brokerNode.setIdString(node.idString());
|
||||
brokerNode.setHost(node.host());
|
||||
brokerNode.setPort(node.port());
|
||||
brokerNode.setRack(node.rack());
|
||||
|
||||
return brokerNode;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getIdString() {
|
||||
return idString;
|
||||
}
|
||||
|
||||
public void setIdString(String idString) {
|
||||
this.idString = idString;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getRack() {
|
||||
return rack;
|
||||
}
|
||||
|
||||
public void setRack(String rack) {
|
||||
this.rack = rack;
|
||||
}
|
||||
|
||||
public boolean isController() {
|
||||
return isController;
|
||||
}
|
||||
|
||||
public void setController(boolean controller) {
|
||||
isController = controller;
|
||||
}
|
||||
}
|
||||
42
src/main/java/com/xuxd/kafka/console/beans/ClusterInfo.java
Normal file
42
src/main/java/com/xuxd/kafka/console/beans/ClusterInfo.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package com.xuxd.kafka.console.beans;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* kafka-console-ui.
|
||||
*
|
||||
* @author xuxd
|
||||
* @date 2021-10-08 13:57:48
|
||||
**/
|
||||
public class ClusterInfo {
|
||||
|
||||
private Set<BrokerNode> nodes;
|
||||
|
||||
private Set<String> authorizedOperations;
|
||||
|
||||
private String clusterId;
|
||||
|
||||
public Set<BrokerNode> getNodes() {
|
||||
return nodes;
|
||||
}
|
||||
|
||||
public void setNodes(Set<BrokerNode> nodes) {
|
||||
this.nodes = nodes;
|
||||
}
|
||||
|
||||
public Set<String> getAuthorizedOperations() {
|
||||
return authorizedOperations;
|
||||
}
|
||||
|
||||
public void setAuthorizedOperations(Set<String> authorizedOperations) {
|
||||
this.authorizedOperations = authorizedOperations;
|
||||
}
|
||||
|
||||
public String getClusterId() {
|
||||
return clusterId;
|
||||
}
|
||||
|
||||
public void setClusterId(String clusterId) {
|
||||
this.clusterId = clusterId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user