public TimelineEntities getEntities(
      String entityType,
      NameValuePair primaryFilter,
      Collection<NameValuePair> secondaryFilter,
      Long windowStart,
      Long windowEnd,
      String fromId,
      Long fromTs,
      Long limit,
      EnumSet<Field> fields,
      UserGroupInformation callerUGI) throws YarnException, IOException {
    long startTime = Time.monotonicNow();
    metrics.incrGetEntitiesOps();
    try {
      TimelineEntities entities = doGetEntities(
          entityType,
          primaryFilter,
          secondaryFilter,
          windowStart,
          windowEnd,
          fromId,
          fromTs,
          limit,
          fields,
          callerUGI);
      metrics.incrGetEntitiesTotal(entities.getEntities().size());
      return entities;
    } finally {
      metrics.addGetEntitiesTime(Time.monotonicNow() - startTime);
    }
  }
@Test
  void testGetOldEntitiesWithOutDomainId() throws Exception {
    TimelineEntities entities = dataManaer.getEntities(
        "OLD_ENTITY_TYPE_1", null, null, null, null, null, null, null, null,
        UserGroupInformation.getCurrentUser());
    assertEquals(2, entities.getEntities().size());
    assertEquals("OLD_ENTITY_ID_2",
        entities.getEntities().get(0).getEntityId());
    assertEquals("OLD_ENTITY_TYPE_1",
        entities.getEntities().get(0).getEntityType());
    assertEquals(TimelineDataManager.DEFAULT_DOMAIN_ID,
        entities.getEntities().get(0).getDomainId());
    assertEquals("OLD_ENTITY_ID_1",
        entities.getEntities().get(1).getEntityId());
    assertEquals("OLD_ENTITY_TYPE_1",
        entities.getEntities().get(1).getEntityType());
    assertEquals(TimelineDataManager.DEFAULT_DOMAIN_ID,
        entities.getEntities().get(1).getDomainId());
  }