mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-05 04:50:55 +08:00
broker元信息中增加Rack信息
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
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;
|
|||||||
* "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 {
|
|||||||
|
|
||||||
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 {
|
|||||||
this.timestamp = timestamp;
|
this.timestamp = timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public String getRack() {
|
||||||
public Object clone() {
|
return rack;
|
||||||
try {
|
}
|
||||||
return super.clone();
|
|
||||||
} catch (CloneNotSupportedException var3) {
|
public void setRack(String rack) {
|
||||||
LOGGER.error("clone BrokerMetadata failed.", var3);
|
this.rack = rack;
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -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 + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user