Chris ...
I just got it sorted out. Thanks I am able to access the value now.

- Shekar

On Fri, Nov 21, 2014 at 12:19 PM, Chris Riccomini <
[email protected]> wrote:

> Hey Shekar,
>
> You should be calling config.get("system.xyz").
>
> Cheers,
> Chris
>
> On 11/21/14 11:21 AM, "Shekar Tippur" <[email protected]> wrote:
>
> >Just to clarify, this is defined in wikipedia-parser.properties
> >
> >On Fri, Nov 21, 2014 at 11:12 AM, Shekar Tippur <[email protected]>
> wrote:
> >
> >> Here is the portion of the config ..
> >>
> >> # Normally, we'd set this much higher, but we want things to look snappy
> >> in the demo.
> >>
> >> systems.kafka.producer.batch.num.messages=1
> >>
> >> systems.kafka.streams.metrics.samza.msg.serde=metrics
> >>
> >> system.xyz=hello
> >>
> >> On Fri, Nov 21, 2014 at 11:03 AM, Chris Riccomini <
> >> [email protected]> wrote:
> >>
> >>> Hey Shekar,
> >>>
> >>> If your config is LITERALLY defined as "system.xyz", then you want
> >>> config.get("system.xyz"). If, however, you have an actual system
> >>>defined,
> >>> and are trying to get a key/value store for it, could you post your
> >>>full
> >>> config?
> >>>
> >>>
> >>>
> >>> Cheers,
> >>> Chris
> >>>
> >>> On 11/21/14 10:57 AM, "Shekar Tippur" <[email protected]> wrote:
> >>>
> >>> >Chris,
> >>> >
> >>> >Thanks for responding.
> >>> >
> >>> >  public void init(Config config, TaskContext context) {
> >>> >
> >>> >    this.store = (KeyValueStore<String, Integer>)
> >>> context.getStore("xyz");
> >>> >
> >>> >  }
> >>> >
> >>> >
> >>> >I defined a init() method
> >>> >
> >>> >I have a property called system.xyz=abc
> >>> >
> >>> >I get a message - key not found: system.xyz
> >>> >
> >>> >On Fri, Nov 21, 2014 at 10:30 AM, Chris Riccomini <
> >>> >[email protected]> wrote:
> >>> >
> >>> >> Hey Shekar,
> >>> >>
> >>> >> You should implement InitableTask. This has an init() method which
> >>> >> receives the job's config. Then you can do config.get(), as you
> >>> >>described
> >>> >> below.
> >>> >>
> >>> >> Cheers,
> >>> >> Chris
> >>> >>
> >>> >> On 11/21/14 10:24 AM, "Shekar Tippur" <[email protected]> wrote:
> >>> >>
> >>> >> >I have a rudimentary question. How do I access the property thats
> >>> >>defined
> >>> >> >in
> >>> >> >
> >>> >> >wikipedia-parser.properties
> >>> >> >
> >>> >> >If I define a property in wikipedia-parser.properties called
> >>> >> >
> >>> >> >system.xyz=Hello
> >>> >> >
> >>> >> >
> >>> >> >I tried to
> >>> >> >
> >>> >> >import org.apache.samza.config.Config;
> >>> >> >
> >>> >> >config.get("system.xyz")
> >>> >> >
> >>> >> >I get a null pointer exception
> >>> >> >
> >>> >> >I am passing the property file as an argument
> >>> >> >
> >>> >> >deploy/samza/bin/run-job.sh
> >>> >>
> >>>
> >>>
> >>>>>>--config-factory=org.apache.samza.config.factories.PropertiesConfigFa
> >>>>>>cto
> >>> >>>ry
> >>> >> >--config-path=file://$PWD/conf/wikipedia-parser.properties.local
> >>> >> >
> >>> >> >- Shekar
> >>> >>
> >>> >>
> >>>
> >>>
> >>
>
>

Reply via email to