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));
}
}
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);
}
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();
}
Aggregations