Repository: apex-core Updated Branches: refs/heads/master a53a5839c -> 65a721fb7
APEXCORE-475 1st part, as discussed in the jira. This will make the client the forward compatible, then in the next release we can change the type to of the applicationt to ApacheApex Project: http://git-wip-us.apache.org/repos/asf/apex-core/repo Commit: http://git-wip-us.apache.org/repos/asf/apex-core/commit/65a721fb Tree: http://git-wip-us.apache.org/repos/asf/apex-core/tree/65a721fb Diff: http://git-wip-us.apache.org/repos/asf/apex-core/diff/65a721fb Branch: refs/heads/master Commit: 65a721fb7356e319a745858d0d48acaa5f535701 Parents: a53a583 Author: sandeshh <[email protected]> Authored: Wed Aug 24 07:12:38 2016 -0700 Committer: sandeshh <[email protected]> Committed: Tue Aug 30 11:10:10 2016 -0700 ---------------------------------------------------------------------- .../src/main/java/com/datatorrent/stram/StramClient.java | 10 ++++++---- .../src/main/java/com/datatorrent/stram/cli/ApexCli.java | 2 +- .../com/datatorrent/stram/client/StramClientUtils.java | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/apex-core/blob/65a721fb/engine/src/main/java/com/datatorrent/stram/StramClient.java ---------------------------------------------------------------------- diff --git a/engine/src/main/java/com/datatorrent/stram/StramClient.java b/engine/src/main/java/com/datatorrent/stram/StramClient.java index 5854ec8..acda0d8 100644 --- a/engine/src/main/java/com/datatorrent/stram/StramClient.java +++ b/engine/src/main/java/com/datatorrent/stram/StramClient.java @@ -94,7 +94,9 @@ import com.datatorrent.stram.plan.logical.LogicalPlan; public class StramClient { private static final Logger LOG = LoggerFactory.getLogger(StramClient.class); - public static final String YARN_APPLICATION_TYPE = "DataTorrent"; + public static final String YARN_APPLICATION_TYPE_DEPRECATED = "DataTorrent"; + public static final String YARN_APPLICATION_TYPE = "ApacheApex"; + public static final String LIB_JARS_SEP = ","; // Configuration @@ -114,7 +116,7 @@ public class StramClient private long clientTimeout = 600000; private String originalAppId; private String queueName; - private String applicationType = YARN_APPLICATION_TYPE; + private String applicationType = YARN_APPLICATION_TYPE_DEPRECATED; private String archives; private String files; private LinkedHashSet<String> resources; @@ -320,7 +322,7 @@ public class StramClient { Class<?>[] defaultClasses; - if (applicationType.equals(YARN_APPLICATION_TYPE)) { + if (applicationType.equals(YARN_APPLICATION_TYPE_DEPRECATED)) { //TODO restrict the security check to only check if security is enabled for webservices. if (UserGroupInformation.isSecurityEnabled()) { defaultClasses = DATATORRENT_SECURITY_CLASSES; @@ -385,7 +387,7 @@ public class StramClient // set the application name appContext.setApplicationName(dag.getValue(LogicalPlan.APPLICATION_NAME)); appContext.setApplicationType(this.applicationType); - if (YARN_APPLICATION_TYPE.equals(this.applicationType)) { + if (YARN_APPLICATION_TYPE_DEPRECATED.equals(this.applicationType)) { //appContext.setMaxAppAttempts(1); // no retries until Stram is HA } http://git-wip-us.apache.org/repos/asf/apex-core/blob/65a721fb/engine/src/main/java/com/datatorrent/stram/cli/ApexCli.java ---------------------------------------------------------------------- diff --git a/engine/src/main/java/com/datatorrent/stram/cli/ApexCli.java b/engine/src/main/java/com/datatorrent/stram/cli/ApexCli.java index 2ecff9f..9db488f 100644 --- a/engine/src/main/java/com/datatorrent/stram/cli/ApexCli.java +++ b/engine/src/main/java/com/datatorrent/stram/cli/ApexCli.java @@ -1591,7 +1591,7 @@ public class ApexCli private List<ApplicationReport> getApplicationList() { try { - return yarnClient.getApplications(Sets.newHashSet(StramClient.YARN_APPLICATION_TYPE)); + return yarnClient.getApplications(Sets.newHashSet(StramClient.YARN_APPLICATION_TYPE_DEPRECATED, StramClient.YARN_APPLICATION_TYPE)); } catch (Exception e) { throw new CliException("Error getting application list from resource manager", e); } http://git-wip-us.apache.org/repos/asf/apex-core/blob/65a721fb/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java ---------------------------------------------------------------------- diff --git a/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java b/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java index 02f2629..c7e3756 100644 --- a/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java +++ b/engine/src/main/java/com/datatorrent/stram/client/StramClientUtils.java @@ -711,7 +711,7 @@ public class StramClientUtils public static ApplicationReport getStartedAppInstanceByName(YarnClient clientRMService, String appName, String user, String excludeAppId) throws YarnException, IOException { - List<ApplicationReport> applications = clientRMService.getApplications(Sets.newHashSet(StramClient.YARN_APPLICATION_TYPE), EnumSet.of(YarnApplicationState.RUNNING, + List<ApplicationReport> applications = clientRMService.getApplications(Sets.newHashSet(StramClient.YARN_APPLICATION_TYPE_DEPRECATED, StramClient.YARN_APPLICATION_TYPE), EnumSet.of(YarnApplicationState.RUNNING, YarnApplicationState.ACCEPTED, YarnApplicationState.NEW, YarnApplicationState.NEW_SAVING, @@ -822,7 +822,7 @@ public class StramClientUtils throws IOException, YarnException { List<ApplicationReport> result = new ArrayList<>(); - List<ApplicationReport> applications = clientRMService.getApplications(Sets.newHashSet(StramClient.YARN_APPLICATION_TYPE), + List<ApplicationReport> applications = clientRMService.getApplications(Sets.newHashSet(StramClient.YARN_APPLICATION_TYPE_DEPRECATED, StramClient.YARN_APPLICATION_TYPE), EnumSet.of(YarnApplicationState.FAILED, YarnApplicationState.FINISHED, YarnApplicationState.KILLED)); Path appsBasePath = new Path(StramClientUtils.getDTDFSRootDir(fs, conf), StramClientUtils.SUBDIR_APPS); for (ApplicationReport ar : applications) {
