kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-6371) FetchMetadata creates unneeded Strings on instantiation
Date Sat, 24 Feb 2018 21:32:00 GMT

    [ https://issues.apache.org/jira/browse/KAFKA-6371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16375782#comment-16375782
] 

ASF GitHub Bot commented on KAFKA-6371:
---------------------------------------

hachikuji closed pull request #4328: KAFKA-6371 Fix DelayedFetch toString
URL: https://github.com/apache/kafka/pull/4328
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/scala/kafka/server/DelayedFetch.scala b/core/src/main/scala/kafka/server/DelayedFetch.scala
index a05131ae8c6..ae3cf46595c 100644
--- a/core/src/main/scala/kafka/server/DelayedFetch.scala
+++ b/core/src/main/scala/kafka/server/DelayedFetch.scala
@@ -44,10 +44,8 @@ case class FetchMetadata(fetchMinBytes: Int,
                          replicaId: Int,
                          fetchPartitionStatus: Seq[(TopicPartition, FetchPartitionStatus)])
{
 
-  override def toString = "[minBytes: " + fetchMinBytes + ", " +
-                          "onlyLeader:" + fetchOnlyLeader + ", "
-                          "onlyCommitted: " + fetchOnlyCommitted + ", "
-                          "partitionStatus: " + fetchPartitionStatus + "]"
+  override def toString = s"[minBytes: $fetchMinBytes, onlyLeader: $fetchOnlyLeader, " +
+                          s"onlyCommitted: $fetchOnlyCommitted, partitionStatus: $fetchPartitionStatus]"
 }
 /**
  * A delayed fetch operation that can be created by the replica manager and watched


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> FetchMetadata creates unneeded Strings on instantiation
> -------------------------------------------------------
>
>                 Key: KAFKA-6371
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6371
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.10.0.1, 0.10.1.1, 0.10.2.1
>            Reporter: Maytee Chinavanichkit
>            Assignee: Maytee Chinavanichkit
>            Priority: Minor
>             Fix For: 0.10.0.2, 0.10.1.2, 0.10.2.2
>
>
> My colleague and I were taking a heap dump to investigate the memory usage of a broker.
From the dump, we saw a number of object strings with the message {{onlyCommitted: <redacted>}}
and {{partitionStatus: <redacted>]}}. Upon investigation, these objects were being instantiated
when the {{FetchMetadata}} object is constructed. The toString method here is malformed and
the last two lines are executed as a block instead of being concatenated. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message