Return-Path: X-Original-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 26B439B80 for ; Mon, 26 Mar 2012 01:29:14 +0000 (UTC) Received: (qmail 71294 invoked by uid 500); 26 Mar 2012 01:29:14 -0000 Delivered-To: apmail-incubator-kafka-dev-archive@incubator.apache.org Received: (qmail 71267 invoked by uid 500); 26 Mar 2012 01:29:14 -0000 Mailing-List: contact kafka-dev-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-dev@incubator.apache.org Received: (qmail 71257 invoked by uid 99); 26 Mar 2012 01:29:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2012 01:29:14 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chris.burroughs@gmail.com designates 209.85.216.175 as permitted sender) Received: from [209.85.216.175] (HELO mail-qc0-f175.google.com) (209.85.216.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2012 01:29:06 +0000 Received: by qcso7 with SMTP id o7so2928081qcs.6 for ; Sun, 25 Mar 2012 18:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=VcKnt979lSdqOVZ7NMs+v5d6k4KDtlw3r8UZUcj0p4A=; b=OxJDcxGsgzrXBjGi2fvQX2mIACOksJBGMA+oy6hN11Kf+n38/Hh3MONvL6owXHX/nX WVYHNCmRlBNQP6rr+7Iuup5SKDWZX8n/AoSqKuN0LJD3AGwaTh/uY0unzwAObul72kbz 3g/s8QIJJNR0UYd2lyX8fotfEoVUdYkWPwJKgvtXVArfV72pu4rzfF5C4t7JjU8pMd5m EHoaUXxVnCriAHDKpDU+8R7sOvuVV0k212KkCCdgA6GIFEq9ijQ+9Jcczy+wGMXsnU+i wIU/6zUEFeVLotzNDCxg26Y3N3sKXIN82AdN9C1c6Pz/hmTbtNFT6MEcw/VxpZI1qcNi ThQg== Received: by 10.224.205.130 with SMTP id fq2mr25357885qab.53.1332725325464; Sun, 25 Mar 2012 18:28:45 -0700 (PDT) Received: from [10.10.49.2] (cl-pat-tr.clearspring.com. [8.18.54.254]) by mx.google.com with ESMTPS id dm8sm27398711qab.18.2012.03.25.18.28.43 (version=SSLv3 cipher=OTHER); Sun, 25 Mar 2012 18:28:44 -0700 (PDT) Message-ID: <4F6FC64B.3050003@gmail.com> Date: Sun, 25 Mar 2012 21:28:43 -0400 From: Chris Burroughs User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: kafka-dev@incubator.apache.org CC: Jay Kreps Subject: Re: kafka.utils.Utils References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org It would also be nice if the truly generic ZKUtils (createEphemeralPathExpectConflict) and the kafka specific (getConsumersPerTopic) were in separate classes. On 03/25/2012 06:23 PM, Jay Kreps wrote: > Hey guys, > > The Utils helpers are meant to be generic non-kafka-specific utility > functions. Ideally it should not have dependencies outside java.* and > scala.*. I notice a lot of code in there that is zookeeper-specific (my > fault I think), that should really be a ZkUtils class. I also notice a lot > of code that isn't properly helper code at all but actually very > kafka-specific stuff. This isn't a big deal, just a little hacky. > > Here are some suspicious methods: > > def getCompressionCodec(props: Properties, codec: String): > CompressionCodec > def getTopicRentionHours(retentionHours: String) : Map[String, Int] > def getTopicFlushIntervals(allIntervals: String) : Map[String, Int] > def getTopicPartitions(allPartitions: String) : Map[String, Int] > def getConsumerTopicMap(consumerTopicString: String) : Map[String, Int] > class SnapshotStats > class Stats > ... > > In general if we are putting domain-specific logic into generic static > helpers like this it probably means we are missing some domain object to > stick these on. > > I will file a ticket to clean these up, but I wanted to email around to try > to explain the motivation. > > -Jay >