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

Tong Li commented on KAFKA-1926:
--------------------------------

Jay, I finally put together a new patch set just for this issue. (the 
SystemTime issue we can address in a separate issue since this patch set is 
already very big). In the new patch set, I will have the following changes made:

This patch set is an attempt to refactor core utils class and remove
    the namespace overlap. Utils class was defined by both clients and core
    projects. Many methods are duplicate. This patch did the following:

    1. Renames the core kafka.utils.Utils class to be kafka.utils.CoreUtils
    2. Removed the abs method in kafka.utils.CoreUtils, anywhere using abs
       method will be replaced with the method in o.a.k.c.u.Utils.abs
    3. Removed the Crc32 class in kafka.utils package. Also use the one
       defined in o.a.k.c.u.Utils class.
    4. Removed asString method in CoreUtils since this was not used.
    5. Removed ReadUnisnedInt (two methods), WriteUnsignedInt (two methods) 
since
       they are completely duplicate of the client methods, both signature and
       implementation are absolutely identical.

I will submit the patch set for you to review. Since this patch set touches so 
many
files, very time consuming. if we can get this in faster, then I won't need to 
do so
many rounds of rebase. Thanks so much.




> Replace kafka.utils.Utils with o.a.k.common.utils.Utils
> -------------------------------------------------------
>
>                 Key: KAFKA-1926
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1926
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 0.8.2.0
>            Reporter: Jay Kreps
>              Labels: newbie, patch
>         Attachments: KAFKA-1926.patch, KAFKA-1926.patch
>
>
> There is currently a lot of duplication between the Utils class in common and 
> the one in core.
> Our plan has been to deprecate duplicate code in the server and replace it 
> with the new common code.
> As such we should evaluate each method in the scala Utils and do one of the 
> following:
> 1. Migrate it to o.a.k.common.utils.Utils if it is a sensible general purpose 
> utility in active use that is not Kafka-specific. If we migrate it we should 
> really think about the API and make sure there is some test coverage. A few 
> things in there are kind of funky and we shouldn't just blindly copy them 
> over.
> 2. Create a new class ServerUtils or ScalaUtils in kafka.utils that will hold 
> any utilities that really need to make use of Scala features to be convenient.
> 3. Delete it if it is not used, or has a bad api.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to