// Twill would also ignore it if it is not running in secure mode.
// The HDFS token should already obtained by Twill.
return launch(copiedProgram, options, hConfFile, cConfFile, new ApplicationLauncher() {
@Override
public TwillController launch(TwillApplication twillApplication) {
TwillPreparer twillPreparer = twillRunner
.prepare(twillApplication);
if (options.isDebug()) {
LOG.info("Starting {} with debugging enabled.", program.getId());
twillPreparer.enableDebugging();
}
List<URI> containerResources = addLogbackConfig(Lists.<URI>newArrayList());
TwillController twillController = twillPreparer
.withDependencies(new HBaseTableUtilFactory().get().getClass())
//TODO: Fix Logging in Distributed Mode.
//.addLogHandler(new PrinterLogHandler(new PrintWriter(System.out, true)))
.addSecureStore(YarnSecureStore.create(HBaseTokenUtils.obtainToken(hConf, new Credentials())))
.withResources(containerResources)