Gets timeline entries from the appropriate data source (AFF4 or REL_DB).

def _GetTimelineStatEntries(client_id, file_path, with_history=True):
  """Gets timeline entries from the appropriate data source (AFF4 or REL_DB)."""

  if data_store.RelationalDBEnabled():
    fn = _GetTimelineStatEntriesRelDB
  else:
    fn = _GetTimelineStatEntriesLegacy

  for v in fn(client_id, file_path, with_history=with_history):
    yield v