Skip to content

Commit

Permalink
LIHADOOP-17890: Set default fields when spark fails to get the job conf
Browse files Browse the repository at this point in the history
RB=671778

G=superfriends-reviewers
R=annag,fli,shanm
A=annag
  • Loading branch information
akshayrai committed Mar 1, 2016
1 parent 2326e72 commit 5c0c2ef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/com/linkedin/drelephant/analysis/AnalyticJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public AnalyticJob setUser(String user) {
public AnalyticJob setStartTime(long startTime) {
// TIMESTAMP range starts from FROM_UNIXTIME(1) = 1970-01-01 00:00:01
if (startTime <= 0) {
startTime = 1;
startTime = 1000; // 1 sec
}
_startTime = startTime;
return this;
Expand All @@ -139,7 +139,7 @@ public AnalyticJob setStartTime(long startTime) {
public AnalyticJob setFinishTime(long finishTime) {
// TIMESTAMP range starts from FROM_UNIXTIME(1) = 1970-01-01 00:00:01
if (finishTime <= 0) {
finishTime = 1;
finishTime = 1000; // 1 sec
}
_finishTime = finishTime;
return this;
Expand Down Expand Up @@ -273,8 +273,8 @@ public AppResult getAnalysis() throws Exception {
result.jobType = jobTypeName;

// Truncate long names
if (result.name.length() > 255) {
result.name = result.name.substring(0, 252) + "...";
if (result.name.length() > 100) {
result.name = result.name.substring(0, 97) + "...";
}

// Load App Heuristic information
Expand Down
6 changes: 3 additions & 3 deletions app/com/linkedin/drelephant/math/Statistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ public static String readableTimespan(long milliseconds) {
seconds %= 60;
StringBuilder sb = new StringBuilder();
if (hours > 0) {
sb.append(hours).append(" hr");
sb.append(hours).append(" hr ");
}
if (minutes > 0) {
sb.append(minutes).append(" min");
sb.append(minutes).append(" min ");
}
if (seconds > 0) {
sb.append(seconds).append(" sec");
sb.append(seconds).append(" sec ");
}
return sb.toString().trim();
}
Expand Down
14 changes: 13 additions & 1 deletion app/com/linkedin/drelephant/util/InfoExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,21 @@ public static void retrieveURLs(AppResult result, SparkApplicationData appData)
logger.error("Encountered error while parsing java options into urls: " + e.getMessage());
}
} else {
logger.error("Unable to retrieve azkaban urls from application [" +
logger.error("Unable to retrieve azkaban properties from application [" +
appData.getGeneralData().getApplicationId() + "] it does not contain [" + SPARK_EXTRA_JAVA_OPTIONS
+ "] property in its spark properties.");

result.scheduler = null;
result.workflowDepth = 0;
result.jobExecId = "";
result.jobDefId = "";
result.flowExecId = "";
result.flowDefId = "";
result.jobExecUrl = "";
result.jobDefUrl = "";
result.flowExecUrl = "";
result.flowDefUrl = "";
result.jobName = "";
}
}

Expand Down

0 comments on commit 5c0c2ef

Please sign in to comment.