diff options
author | CodingCat <zhunansjtu@gmail.com> | 2015-01-10 15:35:41 -0800 |
---|---|---|
committer | Tathagata Das <tathagata.das1565@gmail.com> | 2015-01-10 15:35:41 -0800 |
commit | f0d558b6e6ec0c97280d5844c98fb92c24954cbb (patch) | |
tree | 124f45dc9c788c6e89282a8fb0b3e454f450ecef | |
parent | 0ca51cc31d5dd16aa458956e582eec58bbc31711 (diff) | |
download | spark-f0d558b6e6ec0c97280d5844c98fb92c24954cbb.tar.gz spark-f0d558b6e6ec0c97280d5844c98fb92c24954cbb.tar.bz2 spark-f0d558b6e6ec0c97280d5844c98fb92c24954cbb.zip |
[SPARK-5181] do not print writing WAL log when WAL is disabled
https://issues.apache.org/jira/browse/SPARK-5181
Currently, even the logManager is not created, we still see the log entry
s"Writing to log $record"
a simple fix to make log more accurate
Author: CodingCat <zhunansjtu@gmail.com>
Closes #3985 from CodingCat/SPARK-5181 and squashes the following commits:
0e27dc5 [CodingCat] do not print writing WAL log when WAL is disabled
-rw-r--r-- | streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala index 2ce458cdde..c3d9d7b681 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala @@ -203,9 +203,11 @@ private[streaming] class ReceivedBlockTracker( /** Write an update to the tracker to the write ahead log */ private def writeToLog(record: ReceivedBlockTrackerLogEvent) { - logDebug(s"Writing to log $record") - logManagerOption.foreach { logManager => + if (isLogManagerEnabled) { + logDebug(s"Writing to log $record") + logManagerOption.foreach { logManager => logManager.writeToLog(ByteBuffer.wrap(Utils.serialize(record))) + } } } |