mirror of https://github.com/apache/kafka.git
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.
git-svn-id: https://svn.apache.org/repos/asf/incubator/kafka/trunk@1171889 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
54f49314af
commit
8efb536aff
|
@ -298,7 +298,9 @@ private[log] class Log(val dir: File, val maxSize: Long, val flushInterval: Int,
|
||||||
/**
|
/**
|
||||||
* Flush this log file to the physical disk
|
* Flush this log file to the physical disk
|
||||||
*/
|
*/
|
||||||
def flush() = {
|
def flush() : Unit = {
|
||||||
|
if (unflushed.get == 0) return
|
||||||
|
|
||||||
lock synchronized {
|
lock synchronized {
|
||||||
if(logger.isDebugEnabled)
|
if(logger.isDebugEnabled)
|
||||||
logger.debug("Flushing log '" + name + "' last flushed: " + getLastFlushedTime + " current time: " +
|
logger.debug("Flushing log '" + name + "' last flushed: " + getLastFlushedTime + " current time: " +
|
||||||
|
|
Loading…
Reference in New Issue