提交 59df5b24 编写于 作者: Z zengqiao

broker元信息中增加Rack信息

上级 3e154429
package com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers; package com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List; import java.util.List;
/** /**
...@@ -18,12 +15,11 @@ import java.util.List; ...@@ -18,12 +15,11 @@ import java.util.List;
* "host":null, * "host":null,
* "timestamp":"1546632983233", * "timestamp":"1546632983233",
* "port":-1, * "port":-1,
* "version":4 * "version":4,
* "rack": "CY"
* } * }
*/ */
public class BrokerMetadata implements Cloneable { public class BrokerMetadata implements Cloneable {
private final static Logger LOGGER = LoggerFactory.getLogger(TopicMetadata.class);
private long clusterId; private long clusterId;
private int brokerId; private int brokerId;
...@@ -43,6 +39,8 @@ public class BrokerMetadata implements Cloneable { ...@@ -43,6 +39,8 @@ public class BrokerMetadata implements Cloneable {
private long timestamp; private long timestamp;
private String rack;
public long getClusterId() { public long getClusterId() {
return clusterId; return clusterId;
} }
...@@ -107,14 +105,12 @@ public class BrokerMetadata implements Cloneable { ...@@ -107,14 +105,12 @@ public class BrokerMetadata implements Cloneable {
this.timestamp = timestamp; this.timestamp = timestamp;
} }
@Override public String getRack() {
public Object clone() { return rack;
try {
return super.clone();
} catch (CloneNotSupportedException var3) {
LOGGER.error("clone BrokerMetadata failed.", var3);
} }
return null;
public void setRack(String rack) {
this.rack = rack;
} }
@Override @Override
...@@ -128,6 +124,7 @@ public class BrokerMetadata implements Cloneable { ...@@ -128,6 +124,7 @@ public class BrokerMetadata implements Cloneable {
", jmxPort=" + jmx_port + ", jmxPort=" + jmx_port +
", version='" + version + '\'' + ", version='" + version + '\'' +
", timestamp=" + timestamp + ", timestamp=" + timestamp +
", rack='" + rack + '\'' +
'}'; '}';
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册