diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java index 0e9a4e4..462ba35 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java @@ -272,14 +272,18 @@ public Client(Configuration conf) throws Exception { "If failure count reaches to maxAppAttempts, " + "the application will be failed."); opts.addOption("debug", false, "Dump out debug information"); - opts.addOption("domain", true, "ID of the timeline domain where the " - + "timeline entities will be put"); + opts.addOption("timeline_domain_id", true, "ID of the timeline domain " + + "where the timeline entities will be put. It's optional, and if it is not set, " + + "all the entities will be put into DEFAULT domain."); opts.addOption("view_acls", true, "Users and groups that allowed to " - + "view the timeline entities in the given domain"); + + "view the timeline entities in the given domain. It is used when " + + "-create_timeline_domain is set. If it is not set, view ACLs is set to empty."); opts.addOption("modify_acls", true, "Users and groups that allowed to " - + "modify the timeline entities in the given domain"); - opts.addOption("create", false, "Flag to indicate whether to create the " - + "domain specified with -domain."); + + "modify the timeline entities in the given domain. It is used when " + + "-create_timeline_domain is set. If it is not set, modify ACLs is set to empty."); + opts.addOption("create_timeline_domain", false, + "Flag to indicate whether the client should create the domain " + + "specified with -timeline_domain_id."); opts.addOption("help", false, "Print usage"); opts.addOption("node_label_expression", true, "Node label expression to determine the nodes" @@ -418,9 +422,9 @@ public boolean init(String[] args) throws ParseException { log4jPropFile = cliParser.getOptionValue("log_properties", ""); // Get timeline domain options - if (cliParser.hasOption("domain")) { - domainId = cliParser.getOptionValue("domain"); - toCreateDomain = cliParser.hasOption("create"); + if (cliParser.hasOption("timeline_domain_id")) { + domainId = cliParser.getOptionValue("timeline_domain_id"); + toCreateDomain = cliParser.hasOption("create_timeline_domain"); if (cliParser.hasOption("view_acls")) { viewACLs = cliParser.getOptionValue("view_acls"); } @@ -853,7 +857,10 @@ private void prepareTimelineDomain() { LOG.info("Put the timeline domain: " + TimelineUtils.dumpTimelineRecordtoJSON(domain)); } catch (Exception e) { - LOG.error("Error when putting the timeline domain", e); + LOG.error("Error when putting the timeline domain. " + + "Reset the domain ID, " + + "and let timeline entities be put into DEFAULT domain", e); + domainId = null; } finally { timelineClient.stop(); } diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java index 0ded5bd..99aadae 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java @@ -203,13 +203,13 @@ public void testDSShell(boolean haveDomain) throws Exception { }; if (haveDomain) { String[] domainArgs = { - "--domain", + "--timeline_domain_id", "TEST_DOMAIN", "--view_acls", "reader_user reader_group", "--modify_acls", "writer_user writer_group", - "--create" + "--create_timeline_domain" }; List argsList = new ArrayList(Arrays.asList(args)); argsList.addAll(Arrays.asList(domainArgs));