kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkr...@apache.org
Subject svn commit: r1171889 - /incubator/kafka/trunk/core/src/main/scala/kafka/log/Log.scala
Date Sat, 17 Sep 2011 03:31:15 GMT
Author: jkreps
Date: Sat Sep 17 03:31:15 2011
New Revision: 1171889

URL: http://svn.apache.org/viewvc?rev=1171889&view=rev
Log:
KAFKA-132 Patch from Scott Andreas to avoid flush when there is nothing to flush. Looks like
due to atime attribute in the filesystem this can lead to flushing file metadata.


Modified:
    incubator/kafka/trunk/core/src/main/scala/kafka/log/Log.scala

Modified: incubator/kafka/trunk/core/src/main/scala/kafka/log/Log.scala
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/core/src/main/scala/kafka/log/Log.scala?rev=1171889&r1=1171888&r2=1171889&view=diff
==============================================================================
--- incubator/kafka/trunk/core/src/main/scala/kafka/log/Log.scala (original)
+++ incubator/kafka/trunk/core/src/main/scala/kafka/log/Log.scala Sat Sep 17 03:31:15 2011
@@ -298,7 +298,9 @@ private[log] class Log(val dir: File, va
   /**
    * Flush this log file to the physical disk
    */
-  def flush() = {
+  def flush() : Unit = {
+    if (unflushed.get == 0) return
+
     lock synchronized {
       if(logger.isDebugEnabled)
         logger.debug("Flushing log '" + name + "' last flushed: " + getLastFlushedTime +
" current time: " +



Mime
View raw message