Preconditions.checkArgument(TwillRunnable.class.isAssignableFrom(clz), "%s is not a TwillRunnable.", clz);
if (clz.isAssignableFrom(HttpServiceTwillRunnable.class)) {
// Special case for running http services since we need to instantiate the http service
// using the program classloader.
delegate = new HttpServiceTwillRunnable(program, runId, cConf, runnableName, metricsCollectionService,
discoveryServiceClient, datasetFramework,
transactionSystemClient);
} else if (clz.isAssignableFrom(ServiceWorkerTwillRunnable.class)) {
delegate = new ServiceWorkerTwillRunnable(program, runId, runnableName, program.getClassLoader(), cConf,
metricsCollectionService, datasetFramework,