Search in sources :

Example 1 with NMTimelinePublisher

use of org.apache.hadoop.yarn.server.nodemanager.timelineservice.NMTimelinePublisher in project hadoop by apache.

the class ContainerManagerImpl method createNMTimelinePublisher.

@VisibleForTesting
protected NMTimelinePublisher createNMTimelinePublisher(Context ctxt) {
    NMTimelinePublisher nmTimelinePublisherLocal = new NMTimelinePublisher(ctxt);
    addIfService(nmTimelinePublisherLocal);
    return nmTimelinePublisherLocal;
}
Also used : NMTimelinePublisher(org.apache.hadoop.yarn.server.nodemanager.timelineservice.NMTimelinePublisher) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 2 with NMTimelinePublisher

use of org.apache.hadoop.yarn.server.nodemanager.timelineservice.NMTimelinePublisher 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

NMTimelinePublisher (org.apache.hadoop.yarn.server.nodemanager.timelineservice.NMTimelinePublisher)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 HashMap (java.util.HashMap)1 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 AppCollectorsMap (org.apache.hadoop.yarn.server.api.records.AppCollectorsMap)1