Return-Path: X-Original-To: apmail-incubator-kafka-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-kafka-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6CF889687 for ; Wed, 7 Mar 2012 17:51:47 +0000 (UTC) Received: (qmail 8391 invoked by uid 500); 7 Mar 2012 17:51:47 -0000 Delivered-To: apmail-incubator-kafka-commits-archive@incubator.apache.org Received: (qmail 8288 invoked by uid 500); 7 Mar 2012 17:51:46 -0000 Mailing-List: contact kafka-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kafka-dev@incubator.apache.org Delivered-To: mailing list kafka-commits@incubator.apache.org Received: (qmail 7435 invoked by uid 99); 7 Mar 2012 17:51:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2012 17:51:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2012 17:51:43 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3CF272388CDD; Wed, 7 Mar 2012 17:51:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: kafka-commits@incubator.apache.org From: junrao@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120307175122.3CF272388CDD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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) } }