Skip to content

Commit cc15595

Browse files
committed
Fix the livy 0.4 submission log empty output line for stderr/yarn diag
Signed-off-by: Wei Zhang <[email protected]>
1 parent d4eda5f commit cc15595

File tree

1 file changed

+10
-1
lines changed
  • Utils/hdinsight-node-common/src/com/microsoft/azure/hdinsight/spark/common

1 file changed

+10
-1
lines changed

Utils/hdinsight-node-common/src/com/microsoft/azure/hdinsight/spark/common/SparkBatchJob.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,13 @@ public String getSparkDriverHost() throws IOException {
665665
}
666666

667667
public Observable<SimpleImmutableEntry<MessageInfoType, String>> getSubmissionLog() {
668+
// Those lines are carried per response,
669+
// if there is no value followed, the line should not be sent to console
670+
final Set<String> ignoredEmptyLines = new HashSet<>(Arrays.asList(
671+
"stdout:",
672+
"stderr:",
673+
"yarn diagnostics:"));
674+
668675
return Observable.create(ob -> {
669676
try {
670677
int start = 0;
@@ -685,7 +692,9 @@ public Observable<SimpleImmutableEntry<MessageInfoType, String>> getSubmissionLo
685692
"Bad spark log response: " + httpResponse.getMessage()));
686693

687694
// To subscriber
688-
sparkJobLog.getLog().forEach(line -> ob.onNext(new SimpleImmutableEntry<>(Log, line)));
695+
sparkJobLog.getLog().stream()
696+
.filter(line -> !ignoredEmptyLines.contains(line.trim().toLowerCase()))
697+
.forEach(line -> ob.onNext(new SimpleImmutableEntry<>(Log, line)));
689698

690699
linesGot = sparkJobLog.getLog().size();
691700
start += linesGot;

0 commit comments

Comments
 (0)