}
public void recordProgramStop(String accountId, String appId, String programId,
String pid, long stopTs, String endStatus) {
Key key = new Key.Builder().add(TYPE_RUN_RECORD_STARTED, accountId, appId, programId, pid).build();
RunRecord started = get(key, RunRecord.class);
if (started == null) {
String msg = String.format("No meta for started run record for account %s app %s program %s pid %s exists",
accountId, appId, programId, pid);
LOG.error(msg);
throw new IllegalArgumentException(msg);
}
deleteAll(key);
key = new Key.Builder()
.add(TYPE_RUN_RECORD_COMPLETED, accountId, appId, programId)
.add(getInvertedTsKeyPart(started.getStartTs()))
.add(pid).build();
write(key, new RunRecord(started, stopTs, endStatus));
}