Search in sources :

Example 1 with AppCollectorsMap

use of org.apache.hadoop.yarn.server.api.records.AppCollectorsMap in project hadoop by apache.

the class ReportNewCollectorInfoRequestPBImpl method initLocalCollectorsList.

private void initLocalCollectorsList() {
    ReportNewCollectorInfoRequestProtoOrBuilder p = viaProto ? proto : builder;
    List<AppCollectorsMapProto> list = p.getAppCollectorsList();
    this.collectorsList = new ArrayList<AppCollectorsMap>();
    for (AppCollectorsMapProto m : list) {
        this.collectorsList.add(convertFromProtoFormat(m));
    }
}
Also used : AppCollectorsMap(org.apache.hadoop.yarn.server.api.records.AppCollectorsMap) ReportNewCollectorInfoRequestProtoOrBuilder(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.ReportNewCollectorInfoRequestProtoOrBuilder) AppCollectorsMapProto(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.AppCollectorsMapProto)

Example 2 with AppCollectorsMap

use of org.apache.hadoop.yarn.server.api.records.AppCollectorsMap in project hadoop by apache.

the class ReportNewCollectorInfoRequestPBImpl method addLocalCollectorsToProto.

private void addLocalCollectorsToProto() {
    maybeInitBuilder();
    builder.clearAppCollectors();
    List<AppCollectorsMapProto> protoList = new ArrayList<AppCollectorsMapProto>();
    for (AppCollectorsMap m : this.collectorsList) {
        protoList.add(convertToProtoFormat(m));
    }
    builder.addAllAppCollectors(protoList);
}
Also used : AppCollectorsMap(org.apache.hadoop.yarn.server.api.records.AppCollectorsMap) ArrayList(java.util.ArrayList) AppCollectorsMapProto(org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.AppCollectorsMapProto)

Example 3 with AppCollectorsMap

use of org.apache.hadoop.yarn.server.api.records.AppCollectorsMap in project hadoop by apache.

the class NMCollectorService method reportNewCollectorInfo.

@Override
public ReportNewCollectorInfoResponse reportNewCollectorInfo(ReportNewCollectorInfoRequest request) throws YarnException, IOException {
    List<AppCollectorsMap> newCollectorsList = request.getAppCollectorsList();
    if (newCollectorsList != null && !newCollectorsList.isEmpty()) {
        Map<ApplicationId, String> newCollectorsMap = new HashMap<ApplicationId, String>();
        for (AppCollectorsMap collector : newCollectorsList) {
            ApplicationId appId = collector.getApplicationId();
            String collectorAddr = collector.getCollectorAddr();
            newCollectorsMap.put(appId, collectorAddr);
            // set registered collector address to TimelineClient.
            NMTimelinePublisher nmTimelinePublisher = context.getNMTimelinePublisher();
            if (nmTimelinePublisher != null) {
                nmTimelinePublisher.setTimelineServiceAddress(appId, collectorAddr);
            }
        }
        ((NodeManager.NMContext) context).addRegisteredCollectors(newCollectorsMap);
    }
    return ReportNewCollectorInfoResponse.newInstance();
}
Also used : AppCollectorsMap(org.apache.hadoop.yarn.server.api.records.AppCollectorsMap) HashMap(java.util.HashMap) ApplicationId(org.apache.hadoop.yarn.api.records.ApplicationId) NMTimelinePublisher(org.apache.hadoop.yarn.server.nodemanager.timelineservice.NMTimelinePublisher)

Aggregations

AppCollectorsMap (org.apache.hadoop.yarn.server.api.records.AppCollectorsMap)3 AppCollectorsMapProto (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.AppCollectorsMapProto)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 ReportNewCollectorInfoRequestProtoOrBuilder (org.apache.hadoop.yarn.proto.YarnServerCommonServiceProtos.ReportNewCollectorInfoRequestProtoOrBuilder)1 NMTimelinePublisher (org.apache.hadoop.yarn.server.nodemanager.timelineservice.NMTimelinePublisher)1