* Starts the application master.
*/
public static void main(String[] args) throws Exception {
String zkConnect = System.getenv(EnvKeys.TWILL_ZK_CONNECT);
File twillSpec = new File(Constants.Files.TWILL_SPEC);
RunId runId = RunIds.fromString(System.getenv(EnvKeys.TWILL_RUN_ID));
ZKClientService zkClientService =
ZKClientServices.delegate(
ZKClients.reWatchOnExpire(
ZKClients.retryOnFailure(
ZKClientService.Builder.of(zkConnect).build(),
RetryStrategies.fixDelay(1, TimeUnit.SECONDS))));
Configuration conf = new YarnConfiguration(new HdfsConfiguration(new Configuration()));
Service service = new ApplicationMasterService(runId, zkClientService, twillSpec,
new VersionDetectYarnAMClientFactory(conf), createAppLocation(conf));
new ApplicationMasterMain(String.format("%s/%s/kafka", zkConnect, runId.getId())).doMain(zkClientService, service);
}