Search in sources :

Example 1 with Builder

use of org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeLabelsProto.Builder in project hadoop by apache.

the class NodeHeartbeatRequestPBImpl method mergeLocalToBuilder.

private void mergeLocalToBuilder() {
    if (this.nodeStatus != null) {
        builder.setNodeStatus(convertToProtoFormat(this.nodeStatus));
    }
    if (this.lastKnownContainerTokenMasterKey != null) {
        builder.setLastKnownContainerTokenMasterKey(convertToProtoFormat(this.lastKnownContainerTokenMasterKey));
    }
    if (this.lastKnownNMTokenMasterKey != null) {
        builder.setLastKnownNmTokenMasterKey(convertToProtoFormat(this.lastKnownNMTokenMasterKey));
    }
    if (this.labels != null) {
        builder.clearNodeLabels();
        Builder newBuilder = NodeLabelsProto.newBuilder();
        for (NodeLabel label : labels) {
            newBuilder.addNodeLabels(convertToProtoFormat(label));
        }
        builder.setNodeLabels(newBuilder.build());
    }
    if (this.logAggregationReportsForApps != null) {
        addLogAggregationStatusForAppsToProto();
    }
    if (this.registeredCollectors != null) {
        addRegisteredCollectorsToProto();
    }
}
Also used : NodeLabel(org.apache.hadoop.yarn.api.records.NodeLabel) Builder(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeLabelsProto.Builder) NodeHeartbeatRequestProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeHeartbeatRequestProtoOrBuilder)

Example 2 with Builder

use of org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeLabelsProto.Builder in project hadoop by apache.

the class RegisterNodeManagerRequestPBImpl method mergeLocalToBuilder.

private synchronized void mergeLocalToBuilder() {
    if (this.containerStatuses != null) {
        addNMContainerStatusesToProto();
    }
    if (this.runningApplications != null) {
        addRunningApplicationsToProto();
    }
    if (this.resource != null) {
        builder.setResource(convertToProtoFormat(this.resource));
    }
    if (this.nodeId != null) {
        builder.setNodeId(convertToProtoFormat(this.nodeId));
    }
    if (this.labels != null) {
        builder.clearNodeLabels();
        Builder newBuilder = NodeLabelsProto.newBuilder();
        for (NodeLabel label : labels) {
            newBuilder.addNodeLabels(convertToProtoFormat(label));
        }
        builder.setNodeLabels(newBuilder.build());
    }
    if (this.physicalResource != null) {
        builder.setPhysicalResource(convertToProtoFormat(this.physicalResource));
    }
}
Also used : NodeLabel(org.apache.hadoop.yarn.api.records.NodeLabel) Builder(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeLabelsProto.Builder) RegisterNodeManagerRequestProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.RegisterNodeManagerRequestProtoOrBuilder)

Aggregations

NodeLabel (org.apache.hadoop.yarn.api.records.NodeLabel)2 Builder (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeLabelsProto.Builder)2 NodeHeartbeatRequestProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.NodeHeartbeatRequestProtoOrBuilder)1 RegisterNodeManagerRequestProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.RegisterNodeManagerRequestProtoOrBuilder)1