@ -101,9 +115,8 @@ private[log] class LogSegment(val file: File, val messageSet: FileMessageSet, va
@@ -101,9 +115,8 @@ private[log] class LogSegment(val file: File, val messageSet: FileMessageSet, va
/* A lock that guards all modifications to the log */
privatevallock=newObject
@ -121,7 +134,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@@ -121,7 +134,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@ -135,7 +148,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@@ -135,7 +148,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@ -143,7 +156,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@@ -143,7 +156,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@ -160,7 +173,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@@ -160,7 +173,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
vallast=accum.remove(accum.size-1)
last.messageSet.close()
info("Loading the last segment "+last.file.getAbsolutePath()+" in mutable mode, recovery "+needRecovery)
@ -227,10 +240,11 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@@ -227,10 +240,11 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
//theyarevalid,inserttheminthelog
locksynchronized{
try{
valsegment=segments.view.last
segment.messageSet.append(validMessages)
maybeFlush(numberOfMessages)
varsegment=segments.view.last
maybeRoll(segment)
segment=segments.view.last
segment.append(validMessages)
maybeFlush(numberOfMessages)
}
catch{
casee:IOException=>
@ -301,7 +315,8 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@@ -301,7 +315,8 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@ -317,7 +332,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
@@ -317,7 +332,7 @@ private[log] class Log(val dir: File, val maxSize: Long, val maxMessageSize: Int
newFile.delete()
}
debug("Rolling log '"+name+"' to "+newFile.getName())