incubator-chukwa-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Graham <billgra...@gmail.com>
Subject HttpTriggerAction - configuring N objects
Date Wed, 21 Apr 2010 22:31:41 GMT
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:text/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