@Override
public void deletePipeline(Key rootJobKey, boolean force, boolean async)
throws NoSuchObjectException, IllegalStateException {
if (!force) {
JobRecord rootJobRecord = queryJob(rootJobKey, JobRecord.InflationType.NONE);
switch (rootJobRecord.getState()) {
case FINALIZED:
case STOPPED:
break;
default:
throw new IllegalStateException("Pipeline is still running: " + rootJobRecord);