This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
public class JobMetadata { | |
private DateFormat simple = new SimpleDateFormat("dd MMM yyyy HH:mm:ss:SSS Z"); | |
private String id; | |
private String jobLink; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tony-core/src/main/java/com/linkedin/tony/TonyApplicationMaster.java b/tony-core/src/main/java/com/linkedin/tony/TonyApplicationMaster.java | |
index 8e35fda..687f567 100644 | |
--- a/tony-core/src/main/java/com/linkedin/tony/TonyApplicationMaster.java | |
+++ b/tony-core/src/main/java/com/linkedin/tony/TonyApplicationMaster.java | |
@@ -313,39 +313,57 @@ public class TonyApplicationMaster { | |
* @param args the args from user inputs | |
*/ | |
public static void main(String[] args) { | |
- boolean succeeded = false; | |
- long started; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Checks all elements in {@code metadata} array to see if all | |
* the components are valid. | |
* Ex: If {@code jobIdRegex} is "^application_\\d+_\\d+$", | |
* metadata = [application_1541469337545_0031, 1542325695566, 1542325733637, user1, FAILED] -> true | |
* metadata = [application_1541469337545_0031, 1542325695566, 1542325733637, user2, succeeded] -> false | |
* because status should be upper-cased. | |
* If an element of the array doesn't satisfy its corresponding condition, the metadata is invalid. | |
* @param metadata A String array with metadata components. | |
* @param jobIdRegex Regular expression string to validate metadata. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
public static void main(String[] args) { | |
long started = System.currentTimeMillis(); | |
boolean succeeded = runTonyAM(args); | |
long completed = System.currentTimeMillis(); | |
// By this time jobDir should have been set | |
HistoryFileUtils.createHistoryFile(fs, | |
TonyJobMetadata.newInstance(yarnConf, appIdString, started, completed, succeeded), jobDir); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TonyJobMetadata { | |
private static final Log LOG = LogFactory.getLog(TonyJobMetadata.class); | |
private String id; | |
private String url; | |
private long started; | |
private long completed; | |
private String status; | |
private String user; | |
public TonyJobMetadata(String id, String url, long started, long completed, String status, String user) { |