Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-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 0FC1010CEE for ; Mon, 9 Sep 2013 19:59:12 +0000 (UTC) Received: (qmail 77080 invoked by uid 500); 9 Sep 2013 19:59:11 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 76988 invoked by uid 500); 9 Sep 2013 19:59:11 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 76980 invoked by uid 99); 9 Sep 2013 19:59:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2013 19:59:10 +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 (nike.apache.org: domain of darren.s.shepherd@gmail.com designates 209.85.160.49 as permitted sender) Received: from [209.85.160.49] (HELO mail-pb0-f49.google.com) (209.85.160.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2013 19:59:02 +0000 Received: by mail-pb0-f49.google.com with SMTP id xb4so6549411pbc.22 for ; Mon, 09 Sep 2013 12:58:41 -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:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=/lMDxdNVN95gISnUS8Xp6a/3unoLx8HkKEQdPPOjdt0=; b=Ap4jdp76pgE39FTZpYBFAogrWtOXG5Wy4yHoUiwaJNaU+ahzCpefyOku3QcRLvu5Jy rtx+x/9DMMrSjxOWm6i+dCINFsopa+77goii4lFJDcXZ6W/cWt5U3CILrE91VUZ5p/dN pixE7dyAv66VM4zPEovLoj8KnHYMjH1nTEbO9/VWtzR3mbUbrw3KYoIwfgonqsoaJvF2 6gl28FazEa0iLxUVKX8uZmnqoDZPotxvd0bZnaOY4Po7HiCBdwNh+nMLSb2dKfpWEt7S tAYMiKNZxSO8NUQjCJ4PI9TCCZMH12h9rfoBQY/drWTbRrQV2rf+CmYmKuR86xJt5t5s Pn5g== X-Received: by 10.68.194.161 with SMTP id hx1mr4900839pbc.164.1378756721709; Mon, 09 Sep 2013 12:58:41 -0700 (PDT) Received: from [192.168.3.143] (ip68-109-132-233.ph.ph.cox.net. [68.109.132.233]) by mx.google.com with ESMTPSA id zi1sm18001469pbb.28.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Sep 2013 12:58:40 -0700 (PDT) Message-ID: <522E2896.70603@gmail.com> Date: Mon, 09 Sep 2013 12:59:18 -0700 From: Darren Shepherd User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: dev@cloudstack.apache.org Subject: Re: Configuration variable changes... References: <20CF38CB4385CE4D9D1558D52A0FC0581115B1@SJCPEX01CL03.citrite.net> In-Reply-To: <20CF38CB4385CE4D9D1558D52A0FC0581115B1@SJCPEX01CL03.citrite.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 09/09/2013 10:20 AM, Alex Huang wrote: > As part of the work to pull apart orchestration from self service, I made some changes to how configuration parameters work. The problem with the current system are as follows: > > - configuration variables are all stored as enums in Config.java which means plugins have to modify a single file. We established that to be a bad pattern in some earlier thread. > - No way to tell during upgrades whether a config variable has become useless or if the defaults have changed. > - No way to consistently have variables be dynamically updated. > - No way to consistently migrate a global variable to a scoped variable. > - No way to use more than one type of storage (db) to store config variables. > - Some of the code are still using text strings to retrieve configuration. > - No way to consistently validate variables. (although this is not done yet but I described how it can be done in this new framework.) > > The changes are detailed on wiki [1]. There's a detail list of todo items in ConfigDepotImpl.java if you're interested in picking up any of the work. The old way still works but I recommend we move all new way for new config parameters. > > If everyone reviewed it all and like how it works then we can remove the old way of how it all works. > > --Alex > [1] https://cwiki.apache.org/confluence/display/CLOUDSTACK/Configuration > Can the generic API be ConfigKey get(String paramName, Class type); Just to be a little easier to use. I know the method is discouraged, but I do so some places it would be useful. Besides that I like it. The contract is simple enough that the implementation can become quite flexible. Scoped values seems a little strange though. Why do you define the scope in the key? Why wouldn't you pass the scope when you call valueIn? Its seems a bit odd. Because as the caller, you need to know what the Long is (is it a zone id, pool id, etc.). So it seems more natural to pass valueIn(Scope.Zone, 42) because it is very explicit to the caller. Also, why can't I have a key that is scoped at a different level depending on the calling context. Darren