|
@@ -53,7 +53,7 @@ public class DatanodeInfo extends DatanodeID implements Node {
|
|
private String location = NetworkTopology.DEFAULT_RACK;
|
|
private String location = NetworkTopology.DEFAULT_RACK;
|
|
private String softwareVersion;
|
|
private String softwareVersion;
|
|
private List<String> dependentHostNames = new LinkedList<String>();
|
|
private List<String> dependentHostNames = new LinkedList<String>();
|
|
-
|
|
|
|
|
|
+ private String upgradeDomain;
|
|
|
|
|
|
// Datanode administrative states
|
|
// Datanode administrative states
|
|
public enum AdminStates {
|
|
public enum AdminStates {
|
|
@@ -95,6 +95,7 @@ public class DatanodeInfo extends DatanodeID implements Node {
|
|
this.xceiverCount = from.getXceiverCount();
|
|
this.xceiverCount = from.getXceiverCount();
|
|
this.location = from.getNetworkLocation();
|
|
this.location = from.getNetworkLocation();
|
|
this.adminState = from.getAdminState();
|
|
this.adminState = from.getAdminState();
|
|
|
|
+ this.upgradeDomain = from.getUpgradeDomain();
|
|
}
|
|
}
|
|
|
|
|
|
public DatanodeInfo(DatanodeID nodeID) {
|
|
public DatanodeInfo(DatanodeID nodeID) {
|
|
@@ -120,12 +121,13 @@ public class DatanodeInfo extends DatanodeID implements Node {
|
|
final long capacity, final long dfsUsed, final long remaining,
|
|
final long capacity, final long dfsUsed, final long remaining,
|
|
final long blockPoolUsed, final long cacheCapacity, final long cacheUsed,
|
|
final long blockPoolUsed, final long cacheCapacity, final long cacheUsed,
|
|
final long lastUpdate, final long lastUpdateMonotonic,
|
|
final long lastUpdate, final long lastUpdateMonotonic,
|
|
- final int xceiverCount, final AdminStates adminState) {
|
|
|
|
|
|
+ final int xceiverCount, final AdminStates adminState,
|
|
|
|
+ final String upgradeDomain) {
|
|
this(nodeID.getIpAddr(), nodeID.getHostName(), nodeID.getDatanodeUuid(),
|
|
this(nodeID.getIpAddr(), nodeID.getHostName(), nodeID.getDatanodeUuid(),
|
|
nodeID.getXferPort(), nodeID.getInfoPort(), nodeID.getInfoSecurePort(),
|
|
nodeID.getXferPort(), nodeID.getInfoPort(), nodeID.getInfoSecurePort(),
|
|
nodeID.getIpcPort(), capacity, dfsUsed, remaining, blockPoolUsed,
|
|
nodeID.getIpcPort(), capacity, dfsUsed, remaining, blockPoolUsed,
|
|
cacheCapacity, cacheUsed, lastUpdate, lastUpdateMonotonic,
|
|
cacheCapacity, cacheUsed, lastUpdate, lastUpdateMonotonic,
|
|
- xceiverCount, location, adminState);
|
|
|
|
|
|
+ xceiverCount, location, adminState, upgradeDomain);
|
|
}
|
|
}
|
|
|
|
|
|
/** Constructor */
|
|
/** Constructor */
|
|
@@ -137,6 +139,22 @@ public class DatanodeInfo extends DatanodeID implements Node {
|
|
final long lastUpdate, final long lastUpdateMonotonic,
|
|
final long lastUpdate, final long lastUpdateMonotonic,
|
|
final int xceiverCount, final String networkLocation,
|
|
final int xceiverCount, final String networkLocation,
|
|
final AdminStates adminState) {
|
|
final AdminStates adminState) {
|
|
|
|
+ this(ipAddr, hostName, datanodeUuid, xferPort, infoPort, infoSecurePort,
|
|
|
|
+ ipcPort, capacity, dfsUsed, remaining, blockPoolUsed, cacheCapacity,
|
|
|
|
+ cacheUsed, lastUpdate, lastUpdateMonotonic, xceiverCount,
|
|
|
|
+ networkLocation, adminState, null);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /** Constructor */
|
|
|
|
+ public DatanodeInfo(final String ipAddr, final String hostName,
|
|
|
|
+ final String datanodeUuid, final int xferPort, final int infoPort,
|
|
|
|
+ final int infoSecurePort, final int ipcPort,
|
|
|
|
+ final long capacity, final long dfsUsed, final long remaining,
|
|
|
|
+ final long blockPoolUsed, final long cacheCapacity, final long cacheUsed,
|
|
|
|
+ final long lastUpdate, final long lastUpdateMonotonic,
|
|
|
|
+ final int xceiverCount, final String networkLocation,
|
|
|
|
+ final AdminStates adminState,
|
|
|
|
+ final String upgradeDomain) {
|
|
super(ipAddr, hostName, datanodeUuid, xferPort, infoPort,
|
|
super(ipAddr, hostName, datanodeUuid, xferPort, infoPort,
|
|
infoSecurePort, ipcPort);
|
|
infoSecurePort, ipcPort);
|
|
this.capacity = capacity;
|
|
this.capacity = capacity;
|
|
@@ -150,6 +168,7 @@ public class DatanodeInfo extends DatanodeID implements Node {
|
|
this.xceiverCount = xceiverCount;
|
|
this.xceiverCount = xceiverCount;
|
|
this.location = networkLocation;
|
|
this.location = networkLocation;
|
|
this.adminState = adminState;
|
|
this.adminState = adminState;
|
|
|
|
+ this.upgradeDomain = upgradeDomain;
|
|
}
|
|
}
|
|
|
|
|
|
/** Network location name */
|
|
/** Network location name */
|
|
@@ -300,6 +319,16 @@ public class DatanodeInfo extends DatanodeID implements Node {
|
|
this.location = NodeBase.normalize(location);
|
|
this.location = NodeBase.normalize(location);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** Sets the upgrade domain */
|
|
|
|
+ public void setUpgradeDomain(String upgradeDomain) {
|
|
|
|
+ this.upgradeDomain = upgradeDomain;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /** upgrade domain */
|
|
|
|
+ public String getUpgradeDomain() {
|
|
|
|
+ return upgradeDomain;
|
|
|
|
+ }
|
|
|
|
+
|
|
/** Add a hostname to a list of network dependencies */
|
|
/** Add a hostname to a list of network dependencies */
|
|
public void addDependentHostName(String hostname) {
|
|
public void addDependentHostName(String hostname) {
|
|
dependentHostNames.add(hostname);
|
|
dependentHostNames.add(hostname);
|
|
@@ -341,6 +370,9 @@ public class DatanodeInfo extends DatanodeID implements Node {
|
|
if (!NetworkTopology.DEFAULT_RACK.equals(location)) {
|
|
if (!NetworkTopology.DEFAULT_RACK.equals(location)) {
|
|
buffer.append("Rack: "+location+"\n");
|
|
buffer.append("Rack: "+location+"\n");
|
|
}
|
|
}
|
|
|
|
+ if (upgradeDomain != null) {
|
|
|
|
+ buffer.append("Upgrade domain: "+ upgradeDomain +"\n");
|
|
|
|
+ }
|
|
buffer.append("Decommission Status : ");
|
|
buffer.append("Decommission Status : ");
|
|
if (isDecommissioned()) {
|
|
if (isDecommissioned()) {
|
|
buffer.append("Decommissioned\n");
|
|
buffer.append("Decommissioned\n");
|
|
@@ -380,6 +412,9 @@ public class DatanodeInfo extends DatanodeID implements Node {
|
|
if (!NetworkTopology.DEFAULT_RACK.equals(location)) {
|
|
if (!NetworkTopology.DEFAULT_RACK.equals(location)) {
|
|
buffer.append(" "+location);
|
|
buffer.append(" "+location);
|
|
}
|
|
}
|
|
|
|
+ if (upgradeDomain != null) {
|
|
|
|
+ buffer.append(" " + upgradeDomain);
|
|
|
|
+ }
|
|
if (isDecommissioned()) {
|
|
if (isDecommissioned()) {
|
|
buffer.append(" DD");
|
|
buffer.append(" DD");
|
|
} else if (isDecommissionInProgress()) {
|
|
} else if (isDecommissionInProgress()) {
|