@Override
  protected void updateJob(UUID jobId, PortabilityJob job, JobUpdateValidator validator)
      throws IOException {
    Preconditions.checkNotNull(jobId);
    Transaction transaction = datastore.newTransaction();
    Key key = getJobKey(jobId);

    try {
      Entity previousEntity = transaction.get(key);
      if (previousEntity == null) {
        throw new IOException("Could not find record for jobId: " + jobId);
      }

      if (validator != null) {
        PortabilityJob previousJob = PortabilityJob.fromMap(getProperties(previousEntity));
        validator.validate(previousJob, job);
      }

      Entity newEntity = createUpdatedEntity(key, job.toMap());
      transaction.put(newEntity);
      transaction.commit();
    } catch (Throwable t) {
      transaction.rollback();
      throw new IOException("Failed atomic update of jobId: " + jobId, t);
    }
  }
Verifies a {@code PortabilityJob} already exists for {@code jobId}, and updates the entry to
{@code job}, within a {@code Transaction}. If {@code validator} is non-null,
validator.validate() is called first in the transaction.

@throws IOException if a job didn't already exist for {@code jobId} or there was a problem
    updating it @throws IllegalStateException if validator.validate() failed
extensions/cloud/portability-cloud-google/src/main/java/org/datatransferproject/cloud/google/GoogleJobStore.java