kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject svn commit: r1298030 - in /incubator/kafka/trunk/core/src/main/scala/kafka: common/ErrorMapping.scala message/ByteBufferMessageSet.scala
Date Wed, 07 Mar 2012 17:51:22 GMT
Author: junrao
Date: Wed Mar  7 17:51:21 2012
New Revision: 1298030

URL: http://svn.apache.org/viewvc?rev=1298030&view=rev
Log:
trivial fix to include violated payload size in MessageSizeTooLargeException; patched by Jun
Rao

Modified:
    incubator/kafka/trunk/core/src/main/scala/kafka/common/ErrorMapping.scala
    incubator/kafka/trunk/core/src/main/scala/kafka/message/ByteBufferMessageSet.scala

Modified: incubator/kafka/trunk/core/src/main/scala/kafka/common/ErrorMapping.scala
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/core/src/main/scala/kafka/common/ErrorMapping.scala?rev=1298030&r1=1298029&r2=1298030&view=diff
==============================================================================
--- incubator/kafka/trunk/core/src/main/scala/kafka/common/ErrorMapping.scala (original)
+++ incubator/kafka/trunk/core/src/main/scala/kafka/common/ErrorMapping.scala Wed Mar  7 17:51:21
2012
@@ -58,5 +58,4 @@ class InvalidTopicException(message: Str
 }
 
 class MessageSizeTooLargeException(message: String) extends RuntimeException(message) {
-  def this() = this(null)
 }

Modified: incubator/kafka/trunk/core/src/main/scala/kafka/message/ByteBufferMessageSet.scala
URL: http://svn.apache.org/viewvc/incubator/kafka/trunk/core/src/main/scala/kafka/message/ByteBufferMessageSet.scala?rev=1298030&r1=1298029&r2=1298030&view=diff
==============================================================================
--- incubator/kafka/trunk/core/src/main/scala/kafka/message/ByteBufferMessageSet.scala (original)
+++ incubator/kafka/trunk/core/src/main/scala/kafka/message/ByteBufferMessageSet.scala Wed
Mar  7 17:51:21 2012
@@ -82,8 +82,9 @@ class ByteBufferMessageSet(private val b
     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)
     }
   }
 



Mime
View raw message