From f0d558b6e6ec0c97280d5844c98fb92c24954cbb Mon Sep 17 00:00:00 2001 From: CodingCat Date: Sat, 10 Jan 2015 15:35:41 -0800 Subject: [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 Closes #3985 from CodingCat/SPARK-5181 and squashes the following commits: 0e27dc5 [CodingCat] do not print writing WAL log when WAL is disabled --- .../org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'streaming') 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))) + } } } -- cgit v1.2.3