use of org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto in project hadoop by apache.
the class NodeHeartbeatRequestPBImpl method initNodeLabels.
private void initNodeLabels() {
if (this.labels != null) {
return;
}
NodeHeartbeatRequestProtoOrBuilder p = viaProto ? proto : builder;
if (!p.hasNodeLabels()) {
labels = null;
return;
}
NodeLabelsProto nodeLabels = p.getNodeLabels();
labels = new HashSet<NodeLabel>();
for (NodeLabelProto nlp : nodeLabels.getNodeLabelsList()) {
labels.add(convertFromProtoFormat(nlp));
}
}
use of org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto in project hadoop by apache.
the class GetClusterNodeLabelsResponsePBImpl method initLocalNodeLabels.
private void initLocalNodeLabels() {
GetClusterNodeLabelsResponseProtoOrBuilder p = viaProto ? proto : builder;
List<NodeLabelProto> attributesProtoList = p.getNodeLabelsList();
this.updatedNodeLabels = new ArrayList<NodeLabel>();
for (NodeLabelProto r : attributesProtoList) {
this.updatedNodeLabels.add(convertFromProtoFormat(r));
}
}
use of org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto in project hadoop by apache.
the class GetClusterNodeLabelsResponsePBImpl method addNodeLabelsToProto.
private void addNodeLabelsToProto() {
maybeInitBuilder();
builder.clearNodeLabels();
builder.clearDeprecatedNodeLabels();
List<NodeLabelProto> protoList = new ArrayList<NodeLabelProto>();
List<String> protoListString = new ArrayList<String>();
for (NodeLabel r : this.updatedNodeLabels) {
protoList.add(convertToProtoFormat(r));
protoListString.add(r.getName());
}
builder.addAllNodeLabels(protoList);
builder.addAllDeprecatedNodeLabels(protoListString);
}
use of org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto in project hadoop by apache.
the class AddToClusterNodeLabelsRequestPBImpl method addNodeLabelsToProto.
private void addNodeLabelsToProto() {
maybeInitBuilder();
builder.clearNodeLabels();
builder.clearDeprecatedNodeLabels();
List<NodeLabelProto> protoList = new ArrayList<NodeLabelProto>();
List<String> protoListString = new ArrayList<String>();
for (NodeLabel r : this.updatedNodeLabels) {
protoList.add(convertToProtoFormat(r));
protoListString.add(r.getName());
}
builder.addAllNodeLabels(protoList);
builder.addAllDeprecatedNodeLabels(protoListString);
}
use of org.apache.hadoop.yarn.proto.YarnProtos.NodeLabelProto in project hadoop by apache.
the class AddToClusterNodeLabelsRequestPBImpl method initLocalNodeLabels.
private void initLocalNodeLabels() {
AddToClusterNodeLabelsRequestProtoOrBuilder p = viaProto ? proto : builder;
List<NodeLabelProto> attributesProtoList = p.getNodeLabelsList();
this.updatedNodeLabels = new ArrayList<NodeLabel>();
for (NodeLabelProto r : attributesProtoList) {
this.updatedNodeLabels.add(convertFromProtoFormat(r));
}
}
Aggregations