Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DED24200C80 for ; Thu, 11 May 2017 00:09:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DD5EB160BB4; Wed, 10 May 2017 22:09:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 068E2160B9C for ; Thu, 11 May 2017 00:09:51 +0200 (CEST) Received: (qmail 57429 invoked by uid 500); 10 May 2017 22:09:51 -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 57412 invoked by uid 99); 10 May 2017 22:09:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 May 2017 22:09:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 5C988CDA63 for ; Wed, 10 May 2017 22:09:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.231 X-Spam-Level: *** X-Spam-Status: No, score=3.231 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_INFOUSMEBIZ=0.75, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id rqVTjOUj4fYj for ; Wed, 10 May 2017 22:09:48 +0000 (UTC) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id BFF5F5FC7F for ; Wed, 10 May 2017 22:09:47 +0000 (UTC) Received: by mail-wm0-f52.google.com with SMTP id u65so27089056wmu.1 for ; Wed, 10 May 2017 15:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=aYRnIhmVmj8rObdR0MgYTgFXF+kTbe7Kh5um60+vl3s=; b=eJ7mTGST4URJ64+opf7cT4Z6YqUWc2C9K3vq04FUXw5ra6X/2ChRVhyLjh9e29zDDJ W7jGxMk1GeEsiHsAG7vygnxHIO8OLMjO2qxke3t1wkHkO8s1i25t9o53o0n+5AcIAvYW wFPF8Ldnk998/GeXo0n94wwgG+SWBMqvXFgzFJZNfFOt2JZzBV2symUquok7vZY6ZyZ7 /rq/7cpMU/FT5BgmrTl7wMnBCo2q3dODzDS0IIdXBxTpR97RIfLbmm/VcezslkWltm/A qVR4ggJQgvjhzveG0Yh0EF4BQvk6askTi2NFjDdXl/fo4MRvrze5SgEFDPfQ08fysSeP u0Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=aYRnIhmVmj8rObdR0MgYTgFXF+kTbe7Kh5um60+vl3s=; b=dNWHFQBCF5Ngd/eGo72HsQ19Awh8gXRfGjOzG8nVl0En8EhWDefCDkY+MX42jqPUTQ 2jEBPdVbZ04roXlwBMtOzWz2adnse/AC1OEctcavUZKTnDrcVVDzxnh3rllXP6oYve3A AAZy7rbHKZGmDyoKt5Jb5H6Q061nSELxJ5oo4fgB4NPaRiTOTZHEBsdmc+y9/iSNiZ62 Vc5XGF7PEA7y5BCZyENtxNWj9kRZz0NeROXaJIvoGtYbmR+8zMOL3CaWH+PmlK435DnL 9Q26vlg422XomdAaw5CyXg7cvyphsB+kMGiIM0X4qOqFsxbmXcVJzNDybMb3dgztQ0Em fqew== X-Gm-Message-State: AODbwcABgPOqYzGaIaC+yElTgQDL3kU6UHNhIuCjg2MlWrEmQv2W2juu KtYCVrD/Y3gZATp3iWUlP2pRC3IqOGW+ X-Received: by 10.25.153.78 with SMTP id b75mr3850312lfe.114.1494454186477; Wed, 10 May 2017 15:09:46 -0700 (PDT) MIME-Version: 1.0 Sender: ismaelj@gmail.com Received: by 10.46.83.93 with HTTP; Wed, 10 May 2017 15:09:05 -0700 (PDT) In-Reply-To: References: <1494017117.114782.967315616.7CF5E9B3@webmail.messagingengine.com> <1494188947.3183807.968680040.22904EAD@webmail.messagingengine.com> <1494265650.810700.969747776.5BBA18F0@webmail.messagingengine.com> From: Ismael Juma Date: Wed, 10 May 2017 23:09:05 +0100 X-Google-Sender-Auth: F4oot8NFatOgklVQ-95zElSD_Pg Message-ID: Subject: Re: [DISCUSS] KIP-133: List and Alter Configs Admin APIs To: dev@kafka.apache.org Content-Type: multipart/alternative; boundary=001a11402662eb0fa2054f32ba2d archived-at: Wed, 10 May 2017 22:09:53 -0000 --001a11402662eb0fa2054f32ba2d Content-Type: text/plain; charset=UTF-8 Hi Jason, Thanks for the feedback. I agree that it's useful and reasonably simple to implement. So, I've updated the KIP. Ismael On Wed, May 10, 2017 at 10:48 PM, Jason Gustafson wrote: > Hey Ismael, > > Thanks for the KIP. The use of the Describe API might be a little limited > if it always returns the full set of topics for the requested resource. I > wonder if we can let the client provide a list of the configs they are > interested in. Perhaps something like this: > > DescribeConfigs Request (Version: 0) => [resource [config_name]] > resource => resource_type resource_name > resource_type => INT8 > resource_name => STRING > config_name => STRING > > This would reduce the overhead for use cases where the client only cares > about a small subset of configs. A null array can then indicate the desire > to fetch all configs. What do you think? > > Thanks, > Jason > > On Mon, May 8, 2017 at 10:47 AM, Colin McCabe wrote: > > > On Sun, May 7, 2017, at 20:18, Ismael Juma wrote: > > > Thanks for the feedback Colin. Comments inline. > > > > > > On Sun, May 7, 2017 at 9:29 PM, Colin McCabe > wrote: > > > > > > > > Hmm. What's the behavior if I try to list the configuration for a > > topic > > > > that doesn't exist? It seems like in this case, the whole request > has > > > > to return an error, and nothing gets listed. Shouldn't the protocol > > > > should return an error code and message per element in the batch, > > > > similar to how the other batch protocols work (CreateTopics, > > > > DeleteTopics, etc. etc.) > > > > > > > > > > CreateTopics and DeleteTopics are more like AlterConfigs and that has > an > > > error code per batch. For requests that mutate, this is essential > because > > > the operations are not transactional. I followed the same pattern as > > > ListGroups, but that doesn't take filters, so MetadataRequest is a > better > > > example. For consistency with that, I added an error code per batch. > > > > > > > We also should think about the case where someone requests > > > > configurations from multiple brokers. Since there are multiple > > requests > > > > sent over the wire in this case, there is the chance for some of them > > to > > > > fail when others have succeeded. So the API needs a way of returning > > an > > > > error per batch element. > > > > > > > > > > Yeah, that's true. For the AdminClient side, I followed the same > pattern > > > as > > > ListTopicsResponse, but it seems like DescribeTopicsResults is a better > > > example. I named this request ListConfigs for consistency with > ListAcls, > > > but it looks like they really should be DescribeConfigs and > DescribeAcls. > > > > > > > On the other hand, with configurations, each topic will have a single > > > > configuration, never more and never less. Each cluster will have a > > > > single configuration-- never more and never less. So having separate > > > > Configuration resources doesn't seem to add any value, since they > will > > > > always map 1:1 to existing resources. > > > > > > > > > > Good point. I thought about your proposal in more depth and I agree > that > > > it > > > solves the issue in a nice way. I updated the KIP. > > > > Thanks, Ismael. > > > > > > > > I guess my question is more conceptual-- if these things are all > > > > resources, shouldn't we have a single type to model all of them? We > > > > might want to add configurations to other resources later on as well. > > > > > > > > > > I've been thinking about how we could satisfy the 2 requirements of > > > having > > > a general resource type while making it clear which values are allowed > > > for > > > a given operation. I updated the KIP to use a shared resource type in > the > > > wire, renamed entity to resource, but kept a separate class and enum > for > > > ConfigResource and ConfigResource.Type. They map trivially to Resource > > > and > > > ResourceType. > > > > I still feel like it would be better to use the same type in the API. > > I'm curious what others think here? > > > > > > > > Also, I realised that I was a bit hasty when I changed Config to > > > Collection in the signature of a few methods. I think > Config > > > is the right type. It's a container for a Collection of ConfigEntry > > > instances so that we can provide useful methods to work with the > configs > > > (e.g. exclude items with defaults, etc.). > > > > Good idea. Should we add a Config#get(String) that can get the value of > > a specific ConfigEntry? > > > > > > > > Here's the full diff of the changes: > > > > > > https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action? > > pageId=68719318&selectedPageVersions=14&selectedPageVersions=11 > > > > > > Given that we don't have much time until the KIP freeze and this is an > > > important KIP to make the AdminClient truly useful, I will start the > vote > > > thread. That said, don't hesitate to provide additional feedback. > > > > +1. > > > > best, > > Colin > > > > > > > > Thanks. > > > Ismael > > > --001a11402662eb0fa2054f32ba2d--