incubator-chukwa-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Yang <ey...@yahoo-inc.com>
Subject Re: HttpTriggerAction - configuring N objects
Date Wed, 21 Apr 2010 23:42:08 GMT
I don¹t have good solution to simplify multi-dimension config parameters,
but for the keyword style, it might be useful to have:

Chukwa.trigger.action.HttpTriggerAction.[eventName].1.url=
Chukwa.trigger.action.HttpTriggerAction.[eventName].1.headers=

Hence, we know which Java class to instantiate, and potentially pass in
[eventName], index, type into a configure method.

It could be written like this in hadoop style configuration file:

<property>
  <name>Chukwa.trigger.action.HttpTriggerAction.[eventName].1.url</name>
  <value>http://site.com/firstTrigger</value>
</property>

<property>
  <name>Chukwa.trigger.action.HttpTriggerAction.[eventName].1.headers</name>
  <value>User-Agent:chukwa</value>
</property>

It¹s a possible method to automate config generation using Configuration
object from hadoop and enable a path to build GUI based config editor in
HICC.

Regards,
Eric

On 4/21/10 3:31 PM, "Bill Graham" <billgraham@gmail.com> wrote:

> Hi,
> 
> As a follow up to CHUKWA-477, I'm writing a class called HttpTriggerAction
> that can hit one or more URLs upon successful completion of a demux job. I'd
> like to contribute it back unless anyone objects. Anyway, I'm looking for
> feedback though on how to configure this object.
> 
> The issue is that since the class can hit N urls, it needs N sets of key-value
> configurations. The hadoop configurations model is just name-value pairs
> though, so I'm kicking around ideas around the best way to handle this.
> 
> Specifically, I need to configure values for url, an optional HTTP method
> (default is GET), an optional collection of HTTP headers and an optional post
> body. I was thinking of just making a convention where key values could be
> incremented like below, but wanted to see if there were better suggestions out
> there. 
> 
> chukwa.trigger.action.[eventName].http.1.url=http://site.com/firstTrigger
> chukwa.trigger.action.[eventName].http.1.headers=User-Agent:chukwa
> 
> chukwa.trigger.action.[eventName].http.2.url=http://site.com/secondTrigger
> chukwa.trigger.action.[eventName].http.2.method=POST
> chukwa.trigger.action.[eventName].http.2.headers=User-Agent:chukwa,Accepts:tex
> t/plain
> chukwa.trigger.action.[eventName].http.2.body=Some post body to submit
> ....
> chukwa.trigger.action.[eventName].http.N.url=
> chukwa.trigger.action.[eventName].http.N.method=
> chukwa.trigger.action.[eventName].http.N.headers=
> chukwa.trigger.action.[eventName].http.N.body=
> 
> Since the action could potentially be used by other types of events, the event
> name should be included. This implies that we should add an eventName field to
> the TriggerAction.execute method in CHUKWA-477.
> 
> Thoughts?
> 
> thanks,
> Bill
> 
> 
> 


Mime
View raw message