incubator-s4-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Morel <mmo...@apache.org>
Subject Re: Passing arguments to the adapter code.
Date Wed, 19 Dec 2012 22:43:19 GMT
Hi Shailendra,

you should define named and injectable parameters in your app, eg a field like:
@Inject
@Named('myParam')
MyTypeConvertibleFromString param

then pass it to the adapter node by adding it to the inline parameters:
-p=s4.adapter.output.stream=mktdata,myParam=myValue

You may find more information on the relevant wiki page here:
https://cwiki.apache.org/confluence/display/S4/Configuration

We also updated the input adapter of the twitter example in the yarn
integration branch, and it uses the same approach:
https://github.com/apache/incubator-s4/blob/S4-25/test-apps/twitter-adapter/src/main/java/org/apache/s4/example/twitter/TwitterInputAdapter.java#L56

Hope this helps!

Matthieu

On Wed, Dec 19, 2012 at 9:39 PM, Shailendra Mishra
<shailendrah@gmail.com> wrote:
> Hi:
>
> I would like to pass a value to the adapter code through command line.
> I know the answer for the case where I need to pass an output stream
> which I do as follows:
>
> ./s4 adapter -appClass=partitioner.RawMktDataIA1 -c=clustera
> -p=s4.adapter.output.stream=mktdata
>
> Now suppose I want to pass a portNo or a topic name in case I am
> getting messages from jms; what is the syntax in that case ?
> - Shailendra

Mime
View raw message