Return-Path: X-Original-To: apmail-kafka-dev-archive@www.apache.org Delivered-To: apmail-kafka-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB0C2E345 for ; Mon, 11 Feb 2013 20:09:12 +0000 (UTC) Received: (qmail 28481 invoked by uid 500); 11 Feb 2013 20:09:12 -0000 Delivered-To: apmail-kafka-dev-archive@kafka.apache.org Received: (qmail 28444 invoked by uid 500); 11 Feb 2013 20:09:12 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 28435 invoked by uid 99); 11 Feb 2013 20:09:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2013 20:09:12 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jay.kreps@gmail.com designates 209.85.210.176 as permitted sender) Received: from [209.85.210.176] (HELO mail-ia0-f176.google.com) (209.85.210.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2013 20:09:06 +0000 Received: by mail-ia0-f176.google.com with SMTP id i18so6736690iac.21 for ; Mon, 11 Feb 2013 12:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=ot+5nwTlGKaauHaK4Vq24TJZ99muoAg0GVBXdxCFuf0=; b=A4hBScunLiwRfCYRIPrPe+sGE3StpGs6DEmaLtgnQE943OKN9OCL3SZ5UQ8lxTN683 7ajMdRVJtHjPZqezMMnfbdyUqcEWVC1n8cfqxP2iSLpFe7oehjYbLCHaWGxhQIveju+i Rq1FGDcNZpolf7x2V2agHMkNnHOcu6ALH7dal7I6+1xglxvyZhzZGW5fD95fjx9LsML1 tSrsQyb3vwZVLwCWXd5OwfZtCgs9XyvBsMZbpNVaKdPGZoQNxOea08Q2MlfpebLj9u8O 4CE5PQIsHftAhwAoy2NC8Uxz8YW+kKhmfOiBSGVsvIXJO4xVanIEVQkXoRQL7kvF5bR/ 2USA== MIME-Version: 1.0 X-Received: by 10.50.153.199 with SMTP id vi7mr13487115igb.102.1360613325394; Mon, 11 Feb 2013 12:08:45 -0800 (PST) Received: by 10.231.55.200 with HTTP; Mon, 11 Feb 2013 12:08:45 -0800 (PST) In-Reply-To: References: Date: Mon, 11 Feb 2013 12:08:45 -0800 Message-ID: Subject: Re: admin functionality refactoring From: Jay Kreps To: "dev@kafka.apache.org" Content-Type: multipart/alternative; boundary=e89a8f2357a1efd1d904d578792e X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f2357a1efd1d904d578792e Content-Type: text/plain; charset=ISO-8859-1 One thought I had on some of these things was that it is actually kind of funny that we implement them in zookeeper. Technically we could implement them in Kafka itself which would mean less code (potentially) and also a clean api to clients. The idea is that many of the admin apis are basically changing cluster state. Examples are adding a topic, deleting a topic, altering the log config for a topic, changing the replication factor for a topic, migrating partitions, etc. One way to implement these would be to define an admin topic in kafka. Then standardize a JSON format or something for these command type messages. The API to make these changes would just be to publish a message to this topic. This would allow all brokers to subscribe and carry out these commands in order, and would allow any client that has support for the producer api to publish commands. I think in addition to providing an API this is actually the functionality needed for most of these cluster changes. For example the dynamic config patch I posted is basically implementing a queue like this but in zk for subscribing to and applying config changes. This is not fully thought through, but thought I would just toss the idea out there. -Jay On Fri, Feb 8, 2013 at 3:12 PM, Jay Kreps wrote: > Admin functionality in 0.8 is kind of messy. What should we do? > > There are a bunch of misc. command line tools under kafka.admin. > AdminUtils is the closest thing we have to an admin interface, but it is > weirdly implemented as all static methods. Furthermore its APIs are really > wonky and tend to describe the operation they perform in zookeeper rather > than the high-level thing they accomplish. > > Since people are going to want programmatic access to administrative > functionality it would be good to think this through a bit. The least we > could do would be to refactor AdminUtils into an Admin class and think > through those APIs enough to make them usable from java/scala. This would > mean having a clear API for each thing that the various tools currently do > (create/delete/alter/describe/list topics, migrate partitions, shutdown > broker, etc). > > Arguably some of these should really be RPC apis so other languages can > invoke basic operations like creating and deleting topics. But this is not > critical so we can probably do it later. > > I think it would be good to also think about how we ended up here. I think > we are not putting in place basic APIs that provide a layer of > simplification for common operations. Instead we tend to just be jabbing > directly at Zookeeper from different places using ad hoc methods in > ZkUtils. This is really hard to understand or change. In general we seem to > have trouble thinking through APIs. > > Thoughts? > > -Jay > > --e89a8f2357a1efd1d904d578792e--