You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Jeff Zhang <zj...@gmail.com> on 2016/01/08 09:01:45 UTC

How to add property to configuration file for specific version ?

I want to add one new property for spark's spark-defaults.xml, but I only
want it to be in the latest version. I try to add it in python code, but
seem the ConfigDictionary is immutable. Another way I can think of is using
template, but it seems too large change, and I afraid it may change the
configuration layout in UI. Anyone know How can I do it for specific
version ? Thanks

-- 
Best Regards

Jeff Zhang

Re: How to add property to configuration file for specific version ?

Posted by Mithun Mathew <mi...@gmail.com>.
Hi Jeff

What type of property file are you referring to? Something with the
extension .properties?

Regards
Matt


On Tue, Jan 12, 2016 at 7:57 PM, Jeff Zhang <zj...@gmail.com> wrote:

> Hi Mithun,
>
> Is it supported for PropertyFile as well ?
>
> On Fri, Jan 8, 2016 at 12:56 AM, Mithun Mathew <mi...@gmail.com> wrote:
>
> > This is one way to do it:
> > - Get the existing configurations, and assign a *copy *of it to a
> variable,
> > let's call it config_copy.
> > - Introduce the new parameter based on the version, as a key:value pair
> > into config_copy
> > - Write it back to file using XmlConfig resource
> >
> > Refer:
> >
> >
> https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py#L86-#L107
> >
> > On Fri, Jan 8, 2016 at 12:01 AM, Jeff Zhang <zj...@gmail.com> wrote:
> >
> > > I want to add one new property for spark's spark-defaults.xml, but I
> only
> > > want it to be in the latest version. I try to add it in python code,
> but
> > > seem the ConfigDictionary is immutable. Another way I can think of is
> > using
> > > template, but it seems too large change, and I afraid it may change the
> > > configuration layout in UI. Anyone know How can I do it for specific
> > > version ? Thanks
> > >
> > > --
> > > Best Regards
> > >
> > > Jeff Zhang
> > >
> >
> >
> >
> > --
> > *Mithun Mathew* (Matt)
> >
> >    - www.linkedin.com/in/mithunmatt/
> >
>
>
>
> --
> Best Regards
>
> Jeff Zhang
>



-- 
*Mithun Mathew* (Matt)

   - www.linkedin.com/in/mithunmatt/

Re: How to add property to configuration file for specific version ?

Posted by Jeff Zhang <zj...@gmail.com>.
BTW, what is the practice for adding/removing property in the new version
of component ? I think it is very common for each component. Is there any
example I can refer ?

On Tue, Jan 12, 2016 at 7:57 PM, Jeff Zhang <zj...@gmail.com> wrote:

> Hi Mithun,
>
> Is it supported for PropertyFile as well ?
>
> On Fri, Jan 8, 2016 at 12:56 AM, Mithun Mathew <mi...@gmail.com> wrote:
>
>> This is one way to do it:
>> - Get the existing configurations, and assign a *copy *of it to a
>> variable,
>> let's call it config_copy.
>> - Introduce the new parameter based on the version, as a key:value pair
>> into config_copy
>> - Write it back to file using XmlConfig resource
>>
>> Refer:
>>
>> https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py#L86-#L107
>>
>> On Fri, Jan 8, 2016 at 12:01 AM, Jeff Zhang <zj...@gmail.com> wrote:
>>
>> > I want to add one new property for spark's spark-defaults.xml, but I
>> only
>> > want it to be in the latest version. I try to add it in python code, but
>> > seem the ConfigDictionary is immutable. Another way I can think of is
>> using
>> > template, but it seems too large change, and I afraid it may change the
>> > configuration layout in UI. Anyone know How can I do it for specific
>> > version ? Thanks
>> >
>> > --
>> > Best Regards
>> >
>> > Jeff Zhang
>> >
>>
>>
>>
>> --
>> *Mithun Mathew* (Matt)
>>
>>    - www.linkedin.com/in/mithunmatt/
>>
>
>
>
> --
> Best Regards
>
> Jeff Zhang
>



-- 
Best Regards

Jeff Zhang

Re: How to add property to configuration file for specific version ?

Posted by Jeff Zhang <zj...@gmail.com>.
Hi Mithun,

Is it supported for PropertyFile as well ?

On Fri, Jan 8, 2016 at 12:56 AM, Mithun Mathew <mi...@gmail.com> wrote:

> This is one way to do it:
> - Get the existing configurations, and assign a *copy *of it to a variable,
> let's call it config_copy.
> - Introduce the new parameter based on the version, as a key:value pair
> into config_copy
> - Write it back to file using XmlConfig resource
>
> Refer:
>
> https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py#L86-#L107
>
> On Fri, Jan 8, 2016 at 12:01 AM, Jeff Zhang <zj...@gmail.com> wrote:
>
> > I want to add one new property for spark's spark-defaults.xml, but I only
> > want it to be in the latest version. I try to add it in python code, but
> > seem the ConfigDictionary is immutable. Another way I can think of is
> using
> > template, but it seems too large change, and I afraid it may change the
> > configuration layout in UI. Anyone know How can I do it for specific
> > version ? Thanks
> >
> > --
> > Best Regards
> >
> > Jeff Zhang
> >
>
>
>
> --
> *Mithun Mathew* (Matt)
>
>    - www.linkedin.com/in/mithunmatt/
>



-- 
Best Regards

Jeff Zhang

Re: How to add property to configuration file for specific version ?

Posted by Mithun Mathew <mi...@gmail.com>.
This is one way to do it:
- Get the existing configurations, and assign a *copy *of it to a variable,
let's call it config_copy.
- Introduce the new parameter based on the version, as a key:value pair
into config_copy
- Write it back to file using XmlConfig resource

Refer:
https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/common.py#L86-#L107

On Fri, Jan 8, 2016 at 12:01 AM, Jeff Zhang <zj...@gmail.com> wrote:

> I want to add one new property for spark's spark-defaults.xml, but I only
> want it to be in the latest version. I try to add it in python code, but
> seem the ConfigDictionary is immutable. Another way I can think of is using
> template, but it seems too large change, and I afraid it may change the
> configuration layout in UI. Anyone know How can I do it for specific
> version ? Thanks
>
> --
> Best Regards
>
> Jeff Zhang
>



-- 
*Mithun Mathew* (Matt)

   - www.linkedin.com/in/mithunmatt/