Skip to content

Commit

Permalink
Fix #270, #271: Move APP_TYPE to Constants, change history config fil…
Browse files Browse the repository at this point in the history
…e name to tony-final.xml (#272)

* Write to tony-final.xml instead of config.xml #271

* Move APP_TYPE to Constants #270

* Fixed TestParserUtils
  • Loading branch information
erwa authored May 3, 2019
1 parent fe84c5b commit c05e057
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ private void writeConfigFile(FileSystem fs, Path jobDir) throws IOException {
if (jobDir == null) {
return;
}
Path configFile = new Path(jobDir, "config.xml");
Path configFile = new Path(jobDir, Constants.TONY_FINAL_XML);
try (FSDataOutputStream out = fs.create(configFile)) {
tonyConf.writeXml(out);
} catch (IOException e) {
Expand Down
1 change: 1 addition & 0 deletions tony-core/src/main/java/com/linkedin/tony/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public class Constants {
public static final String TONY_HISTORY_INTERMEDIATE = "intermediate";

// Configuration related constants
public static final String APP_TYPE = "TONY";
// Name of the file containing all configuration keys and their default values
public static final String TONY_DEFAULT_XML = "tony-default.xml";
// Default file name of user-provided configuration file
Expand Down
4 changes: 1 addition & 3 deletions tony-core/src/main/java/com/linkedin/tony/TonyClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@
public class TonyClient implements AutoCloseable {
private static final Log LOG = LogFactory.getLog(TonyClient.class);

private static final String APP_TYPE = "TONY";

// Configurations
private YarnClient yarnClient;
private HdfsConfiguration hdfsConf = new HdfsConfiguration();
Expand Down Expand Up @@ -233,7 +231,7 @@ public void submitApplication(ApplicationSubmissionContext appContext)
String appName = tonyConf.get(TonyConfigurationKeys.APPLICATION_NAME,
TonyConfigurationKeys.DEFAULT_APPLICATION_NAME);
appContext.setApplicationName(appName);
appContext.setApplicationType(APP_TYPE);
appContext.setApplicationType(Constants.APP_TYPE);

// Set up resource type requirements
Resource capability = Resource.newInstance((int) amMemory, amVCores);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public static List<JobConfig> parseConfig(FileSystem fs, Path jobFolderPath) {
return Collections.emptyList();
}

Path configFilePath = new Path(jobFolderPath, "config.xml");
Path configFilePath = new Path(jobFolderPath, Constants.TONY_FINAL_XML);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
List<JobConfig> configs = new ArrayList<>();

Expand Down

0 comments on commit c05e057

Please sign in to comment.