[ https://issues.apache.org/jira/browse/KAFKA-2903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15046561#comment-15046561 ]
Pengwei commented on KAFKA-2903: -------------------------------- Yes we can also add comment on it. But if in the future version, someone need to use this read API will get error when using a slice FileMessageSet. so modify this code is better? Because it is only one line of code, and add comment will use much word on it > FileMessageSet's read method maybe has problem when start is not zero > --------------------------------------------------------------------- > > Key: KAFKA-2903 > URL: https://issues.apache.org/jira/browse/KAFKA-2903 > Project: Kafka > Issue Type: Bug > Components: log > Affects Versions: 0.8.2.1, 0.9.0.0 > Reporter: Pengwei > Assignee: Jay Kreps > Fix For: 0.9.1.0 > > > now the code is : > def read(position: Int, size: Int): FileMessageSet = { > ..... > new FileMessageSet(file, > channel, > start = this.start + position, > end = math.min(this.start + position + size, > sizeInBytes())) > } > if this.start is not 0, the end is only the FileMessageSet's size, not the > actually position of end position. > the end parameter should be: > end = math.min(this.start + position + size, this.start+sizeInBytes()) -- This message was sent by Atlassian JIRA (v6.3.4#6332)