File yamlConfigFile = new File(yamlConfigFileName);
if (!yamlConfigFile.exists()) {
throw new IllegalArgumentException("YAML app_config_spec file: '" + yamlConfigFileName
+ "' does not exist");
}
final AppLauncher launcher = new AppLauncher(applicationSpecFactory, yamlConfigFile);
launcher.launch();
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {
launcher.cleanup();
}
}));
final ApplicationSpec appSpec = launcher.getApplicationSpec();
// Repeatedly print status
final HelixConnection connection = launcher.pollForConnection();
final ClusterId clusterId = ClusterId.from(appSpec.getAppName());
// TODO: this is a hack -- TaskDriver should accept a connection instead of a manager
HelixManager manager = new ZKHelixManager(new HelixRole() {
@Override
public HelixConnection getConnection() {