@Override
  public Map<String, Integer> getCounts(UUID jobId) {
    Query<Entity> query = getCountsQuery(jobId);
    QueryResults<Entity> results = datastore.run(query);
    ImmutableMap.Builder<String, Integer> countsMapBuilder = ImmutableMap.builder();

    while (results.hasNext()) {
      Entity result = results.next();
      String dataType = result.getKey().getName();
      long count = result.getLong(COUNTS_FIELD);
      countsMapBuilder.put(dataType, (int) count);
    }

    return countsMapBuilder.build();
  }
Finds the ID of the first {@link PortabilityJob} in state {@code jobState} in Datastore, or
null if none found.

<p>TODO(rtannenbaum): Order by creation time so we can process jobs in a FIFO manner. Trying to
OrderBy.asc("created") currently fails because we don't yet have an index set up.
extensions/cloud/portability-cloud-google/src/main/java/org/datatransferproject/cloud/google/GoogleJobStore.java