You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jay Kreps (JIRA)" <ji...@apache.org> on 2012/10/12 02:41:02 UTC

[jira] [Updated] (KAFKA-569) Cleanup kafka.utils.Utils

     [ https://issues.apache.org/jira/browse/KAFKA-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jay Kreps updated KAFKA-569:
----------------------------

    Attachment: KAFKA-569.patch

This patch has a large number of trivial changes.

Here is a summary:
- Make bad names good
- Create kafka.api.ApiUtils and move all protocol parsing related methods there
- Get rid of the encoding argument in ApiUtils since our protocol requires UTF8, so making this changable is not good.
- Move zookeeper method into ZkUtils, delete random duplicate version of that code elsewhere
- Move SyncJSON which was inside Utils (!) into its own file
- Create ClientUtils and put getTopicMetadata() there
- Create CommandLineUtils and put command line stuff there
- Delete a few silly, unused methods
- Move getTopicPartition into LogManager since it is an implementation detail of LogManager
- Move getAllBrokersFromBrokerList into BrokerPartitionInfo, the only place it is used
- Get rid of Utils.getNextRandomInt. Since random is synchronized it is better to not have a single one.
- Changed DefaultEventHandler to user a counter rather than Utils.randomInt--this will be more evenly distributed since it is true round-robin.
- Delete ~5 custom property parsing methods that were jammed into Utils. Add a generic method VerifiableProperties.getMap that replaces them all.
                
> Cleanup kafka.utils.Utils
> -------------------------
>
>                 Key: KAFKA-569
>                 URL: https://issues.apache.org/jira/browse/KAFKA-569
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.8
>            Reporter: Jay Kreps
>            Assignee: Jay Kreps
>         Attachments: KAFKA-569.patch
>
>
> kafka.utils.Utils is a real mess. It is full of odd little pieces of business logic dropped there. We should clean this up.

--
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