trivial fix to include violated payload size in MessageSizeTooLargeException; patched by Jun Rao

git-svn-id: https://svn.apache.org/repos/asf/incubator/kafka/trunk@1298030 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jun Rao 2012-03-07 17:51:21 +00:00
parent 0443e2dd73
commit 624a361e01
2 changed files with 3 additions and 3 deletions

View File

@ -58,5 +58,4 @@ class InvalidTopicException(message: String) extends RuntimeException(message) {
}
class MessageSizeTooLargeException(message: String) extends RuntimeException(message) {
def this() = this(null)
}

View File

@ -82,8 +82,9 @@ class ByteBufferMessageSet(private val buffer: ByteBuffer,
var shallowIter = internalIterator(true)
while(shallowIter.hasNext){
var messageAndOffset = shallowIter.next
if (messageAndOffset.message.payloadSize > maxMessageSize)
throw new MessageSizeTooLargeException
val payloadSize = messageAndOffset.message.payloadSize
if ( payloadSize > maxMessageSize)
throw new MessageSizeTooLargeException("payload size of " + payloadSize + " larger than " + maxMessageSize)
}
}