Search in sources :

Example 1 with VersionDetectYarnAMClientFactory

use of com.continuuity.weave.internal.yarn.VersionDetectYarnAMClientFactory in project weave by continuuity.

the class ApplicationMasterMain method main.

/**
   * Starts the application master.
   */
public static void main(String[] args) throws Exception {
    String zkConnect = System.getenv(EnvKeys.WEAVE_ZK_CONNECT);
    File weaveSpec = new File(Constants.Files.WEAVE_SPEC);
    RunId runId = RunIds.fromString(System.getenv(EnvKeys.WEAVE_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, weaveSpec, new VersionDetectYarnAMClientFactory(conf), createAppLocation(conf));
    new ApplicationMasterMain(String.format("%s/%s/kafka", zkConnect, runId.getId())).doMain(zkClientService, service);
}
Also used : ZKClientService(com.continuuity.weave.zookeeper.ZKClientService) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) HdfsConfiguration(org.apache.hadoop.hdfs.HdfsConfiguration) Configuration(org.apache.hadoop.conf.Configuration) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) ZKClientService(com.continuuity.weave.zookeeper.ZKClientService) Service(com.google.common.util.concurrent.Service) RunId(com.continuuity.weave.api.RunId) HdfsConfiguration(org.apache.hadoop.hdfs.HdfsConfiguration) File(java.io.File) VersionDetectYarnAMClientFactory(com.continuuity.weave.internal.yarn.VersionDetectYarnAMClientFactory)

Aggregations

RunId (com.continuuity.weave.api.RunId)1 VersionDetectYarnAMClientFactory (com.continuuity.weave.internal.yarn.VersionDetectYarnAMClientFactory)1 ZKClientService (com.continuuity.weave.zookeeper.ZKClientService)1 Service (com.google.common.util.concurrent.Service)1 File (java.io.File)1 Configuration (org.apache.hadoop.conf.Configuration)1 HdfsConfiguration (org.apache.hadoop.hdfs.HdfsConfiguration)1 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)1