diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineWriterImpl.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineWriterImpl.java index 172f982..6ec330b 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineWriterImpl.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/HBaseTimelineWriterImpl.java @@ -128,11 +128,21 @@ public TimelineWriteResponse write(String clusterId, String userId, // if the entity is the application, the destination is the application // table boolean isApplication = TimelineStorageUtils.isApplicationEntity(te); - byte[] rowKey = isApplication ? - ApplicationRowKey.getRowKey(clusterId, userId, flowName, flowRunId, - appId) : - EntityRowKey.getRowKey(clusterId, userId, flowName, flowRunId, appId, - te.getType(), te.getId()); + byte[] rowKey = null; + if (isApplication) { + // for some reason if one of the fields is null when + // online aggregation is triggered YARN-5097 + // do not proceed, just return + if ((flowName == null) || (appId == null) || (clusterId == null) + || (userId == null)) { + return putStatus; + } + rowKey = ApplicationRowKey.getRowKey(clusterId, userId, flowName, + flowRunId, appId); + } else { + rowKey = EntityRowKey.getRowKey(clusterId, userId, flowName, flowRunId, + appId, te.getType(), te.getId()); + } storeInfo(rowKey, te, flowVersion, isApplication); storeEvents(rowKey, te.getEvents(), isApplication);