@ -54,7 +54,7 @@ class FileMessageSet private[kafka](@volatile var file: File,
@@ -54,7 +54,7 @@ class FileMessageSet private[kafka](@volatile var file: File,
/* if this is not a slice, update the file pointer to the end of the file */
if(!isSlice)
/* set the file position to the last byte in the file */
@ -66,12 +66,25 @@ class FileMessageSet private[kafka](@volatile var file: File,
@@ -66,12 +66,25 @@ class FileMessageSet private[kafka](@volatile var file: File,
@ -223,9 +236,17 @@ class FileMessageSet private[kafka](@volatile var file: File,
@@ -223,9 +236,17 @@ class FileMessageSet private[kafka](@volatile var file: File,
*/
defclose(){
flush()
trim()
channel.close()
}
/**
*Trimfilewhencloseorrolltonextfile
*/
deftrim(){
truncateTo(sizeInBytes())
}
/**
*Deletethismessagesetfromthefilesystem
*@returnTrueiffthismessagesetwasdeleted.
@ -272,6 +293,37 @@ class FileMessageSet private[kafka](@volatile var file: File,
@@ -272,6 +293,37 @@ class FileMessageSet private[kafka](@volatile var file: File,
valLogFlushSchedulerIntervalMsDoc="The frequency in ms that the log flusher checks whether any log needs to be flushed to disk"
valLogFlushIntervalMsDoc="The maximum time in ms that a message in any topic is kept in memory before flushed to disk"
valLogFlushOffsetCheckpointIntervalMsDoc="The frequency with which we update the persistent record of the last flush which acts as the log recovery point"
valLogPreAllocateEnableDoc="Should pre allocate file when create new segment? If you are using Kafka on Windows, you probably need to set it to true."
valNumRecoveryThreadsPerDataDirDoc="The number of threads per data directory to be used for log recovery at startup and flushing at shutdown"
valAutoCreateTopicsEnableDoc="Enable auto creation of topic on the server"
valMinInSyncReplicasDoc="define the minimum number of replicas in ISR needed to satisfy a produce request with required.acks=-1 (or all)"