EntityGroupFSTimelineStore extends CompositeService implements TimelineStore { @Override public TimelineEvents getEntityTimelines(String entityType, SortedSet<String> entityIds, Long limit, Long windowStart, Long windowEnd, Set<String> eventTypes) throws IOException { LOG.debug("getEntityTimelines type={} ids={}", entityType, entityIds); TimelineEvents returnEvents = new TimelineEvents(); List<EntityCacheItem> relatedCacheItems = new ArrayList<>(); if (entityIds == null || entityIds.isEmpty()) { return returnEvents; } for (String entityId : entityIds) { LOG.debug("getEntityTimeline type={} id={}", entityType, entityId); List<TimelineStore> stores = getTimelineStoresForRead(entityId, entityType, relatedCacheItems); for (TimelineStore store : stores) { LOG.debug("Try timeline store {}:{} for the request", store.getName(), store.toString()); SortedSet<String> entityIdSet = new TreeSet<>(); entityIdSet.add(entityId); TimelineEvents events = store.getEntityTimelines(entityType, entityIdSet, limit, windowStart, windowEnd, eventTypes); if (events != null) { returnEvents.addEvents(events.getAllEvents()); } } } return returnEvents; } EntityGroupFSTimelineStore(); @Override TimelineEntities getEntities(String entityType, Long limit,
      Long windowStart, Long windowEnd, String fromId, Long fromTs,
      NameValuePair primaryFilter, Collection<NameValuePair> secondaryFilters,
      EnumSet<Field> fieldsToRetrieve, CheckAcl checkAcl); @Override TimelineEntity getEntity(String entityId, String entityType,
      EnumSet<Field> fieldsToRetrieve); @Override TimelineEvents getEntityTimelines(String entityType,
      SortedSet<String> entityIds, Long limit, Long windowStart,
      Long windowEnd, Set<String> eventTypes); @Override TimelineDomain getDomain(String domainId); @Override TimelineDomains getDomains(String owner); @Override TimelinePutResponse put(TimelineEntities data); @Override void put(TimelineDomain domain);  }
@Test public void testNullCheckGetEntityTimelines() throws Exception { try { store.getEntityTimelines("YARN_APPLICATION", null, null, null, null, null); } catch (NullPointerException e) { Assert.fail("NPE when getEntityTimelines called with Null EntityIds"); } }