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

Jun Rao commented on KAFKA-696:
-------------------------------

Thanks for the patch. Some comments:

1. RequestOrResponse.handleError: We probably shouldn't couple the error 
response generation and the sending of the response through RequestChannel. 
It's probably better if we change handleError() to sth like 
generateErrorResponse() that only takes an error code and generates a response. 
The sending of the response will be done in KafkaApis. Similarly, I think the 
error logging should be done in KafkaApis.handle() too.

2. ProducerRequest: When printing out data, in addition to the key, it would be 
useful to print out messageSet.sizeInBytes().

3. KafkaApis: 
3.1 Doesn't compile.
3.2 There are statements like the following in the handling of each type of 
request. Could we move them to handle() and remove the special printing for 
versionId, correlationId, and clientId?
    if(requestLogger.isTraceEnabled)
      requestLogger.trace("Handling LeaderAndIsrRequest v%d with correlation id 
%d from client %s: %s"
            .format(leaderAndIsrRequest.versionId, 
leaderAndIsrRequest.correlationId, leaderAndIsrRequest.clientId, 
leaderAndIsrRequest.toString))

4. RequestChannel.Request: Could you remove versionId, correlationId, clientId 
in the trace statement in updateRequestMetrics() and remove the corresponding 
deserialization logic?

                
> Fix toString() API for all requests to make logging easier to read
> ------------------------------------------------------------------
>
>                 Key: KAFKA-696
>                 URL: https://issues.apache.org/jira/browse/KAFKA-696
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.8
>            Reporter: Neha Narkhede
>            Assignee: Sriram Subramanian
>         Attachments: cleanup-v1.patch
>
>
> It will be useful to have consistent logging styles for all requests. Right 
> now, we depend on the default toString implementation and the problem is that 
> it is very hard to read and prints out unnecessary information like the 
> ByteBuffer.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to