You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by "Gabriel Commeau (JIRA)" <ji...@apache.org> on 2013/03/13 23:08:14 UTC

[jira] [Comment Edited] (FLUME-1941) Support defaults or inheritance in configs

    [ https://issues.apache.org/jira/browse/FLUME-1941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13601682#comment-13601682 ] 

Gabriel Commeau edited comment on FLUME-1941 at 3/13/13 10:08 PM:
------------------------------------------------------------------

That's a great idea! Long configuration files are not only hard to maintain, but error-prone as well.
I'd add that a prototype should be able to inherit from another prototype, in a recursive matter: 

 agent.sinks.sink-proto-2.__prototype__ = sink-proto-1
 agent.sinks.sink-proto-2.path = /var/log/foo/bar2


Additionally (related to default values), I'd suggest if it does not break the backward compatibility to add meta-variables that could be reused like below:

 my.basic.variable = 100
 agent1.sinks.sink1.batchSize = ${my.basic.variable}

                
      was (Author: gcommeau):
    That's a great idea! Long configuration files are not only hard to maintain, but error-prone as well.
I'd add that a prototype should be able to inherit from another prototype, in a recursive matter: 

 agent.sinks.sink-proto-2.__prototype__ = sink-proto-1
 agent.sinks.sink-proto-2.path = /var/log/foo/bar2


Additionally (related to default values), would it break the backward compatibility to add meta-variables that could be reused like below?

 my.basic.variable = 100
 agent1.sinks.sink1.batchSize = ${my.basic.variable}

                  
> Support defaults or inheritance in configs
> ------------------------------------------
>
>                 Key: FLUME-1941
>                 URL: https://issues.apache.org/jira/browse/FLUME-1941
>             Project: Flume
>          Issue Type: New Feature
>          Components: Configuration
>            Reporter: Mike Percy
>             Fix For: v1.4.0
>
>
> Proposal to support defaults or inheritance in configs.
> The idea is to create a "prototypal" component config, such as a source or sink, which is not necessarily instantiated but is used to avoid repetitive configurations when creating multiple components of the same type. A great example of this is users who define 5 HDFS sinks to increase write parallelism, but they each contain many of the same configuration parameters and differ only in their name and path.
> Basic idea:
> {noformat}
> agent.sinks.sink-proto-1.type = my-sink
> agent.sinks.sink-proto-1.path = /var/log/foo/bar
> agent.sinks.sink-proto-1.serializer = MySerializer$Builder
> agent.sinks.sink-proto-1.credentials = mpercy
> agent.sinks.sink-1.__prototype__ = sink-proto-1
> agent.sinks.sink-1.path = /var/log/baz/blam
> agent.sinks.sink-2.__prototype__ = sink-proto-1
> agent.sinks.sink-2.path = /var/log/glerp/bazinga
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira