|
@@ -27,6 +27,7 @@ import javax.xml.bind.annotation.XmlAccessType;
|
|
import javax.xml.bind.annotation.XmlAccessorType;
|
|
import javax.xml.bind.annotation.XmlAccessorType;
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
|
|
|
|
+import org.apache.hadoop.yarn.api.records.NodeAttribute;
|
|
import org.apache.hadoop.yarn.api.records.NodeId;
|
|
import org.apache.hadoop.yarn.api.records.NodeId;
|
|
import org.apache.hadoop.yarn.api.records.NodeState;
|
|
import org.apache.hadoop.yarn.api.records.NodeState;
|
|
import org.apache.hadoop.yarn.server.api.records.OpportunisticContainersStatus;
|
|
import org.apache.hadoop.yarn.server.api.records.OpportunisticContainersStatus;
|
|
@@ -62,6 +63,7 @@ public class NodeInfo {
|
|
protected ResourceUtilizationInfo resourceUtilization;
|
|
protected ResourceUtilizationInfo resourceUtilization;
|
|
protected ResourceInfo usedResource;
|
|
protected ResourceInfo usedResource;
|
|
protected ResourceInfo availableResource;
|
|
protected ResourceInfo availableResource;
|
|
|
|
+ protected NodeAttributesInfo nodeAttributesInfo;
|
|
|
|
|
|
public NodeInfo() {
|
|
public NodeInfo() {
|
|
} // JAXB needs this
|
|
} // JAXB needs this
|
|
@@ -113,6 +115,19 @@ public class NodeInfo {
|
|
Collections.sort(nodeLabels);
|
|
Collections.sort(nodeLabels);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // add attributes
|
|
|
|
+ Map<String, Set<NodeAttribute>> nodeAttributes =
|
|
|
|
+ ni.getAllNodeAttributes();
|
|
|
|
+ nodeAttributesInfo = new NodeAttributesInfo();
|
|
|
|
+ if (nodeAttributes != null) {
|
|
|
|
+ for (Set<NodeAttribute> attrs : nodeAttributes.values()) {
|
|
|
|
+ for (NodeAttribute attribute : attrs) {
|
|
|
|
+ NodeAttributeInfo info = new NodeAttributeInfo(attribute);
|
|
|
|
+ this.nodeAttributesInfo.addNodeAttributeInfo(info);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// add allocation tags
|
|
// add allocation tags
|
|
allocationTags = new AllocationTagsInfo();
|
|
allocationTags = new AllocationTagsInfo();
|
|
Map<String, Long> allocationTagsInfo = ni.getAllocationTagsWithCount();
|
|
Map<String, Long> allocationTagsInfo = ni.getAllocationTagsWithCount();
|