Repository: spark Updated Branches: refs/heads/branch-1.2 cce003d75 -> f04ff9d37
[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 <[email protected]> Closes #3985 from CodingCat/SPARK-5181 and squashes the following commits: 0e27dc5 [CodingCat] do not print writing WAL log when WAL is disabled (cherry picked from commit f0d558b6e6ec0c97280d5844c98fb92c24954cbb) Signed-off-by: Tathagata Das <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/f04ff9d3 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/f04ff9d3 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/f04ff9d3 Branch: refs/heads/branch-1.2 Commit: f04ff9d37ae312dccd16843df7d0e3a03c30e403 Parents: cce003d Author: CodingCat <[email protected]> Authored: Sat Jan 10 15:35:41 2015 -0800 Committer: Tathagata Das <[email protected]> Committed: Sat Jan 10 15:36:05 2015 -0800 ---------------------------------------------------------------------- .../spark/streaming/scheduler/ReceivedBlockTracker.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/f04ff9d3/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala ---------------------------------------------------------------------- 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 2ce458c..c3d9d7b 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))) + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
