Yes, u can pass user defined configuration values.
You can retrieve the same by
conf.get("insertScanBoltTestData").toString() in the spout/bolt
open/prepare method.
On 12/31/13, Pete Carlson <pete@tetraconcepts.com> wrote:
> From reading the Storm API Config class i.e.,
> http://nathanmarz.github.io/storm/doc/backtype/storm/Config.html
>
> it states "you may put other configurations in any of the configs. Storm
> will ignore anything it doesn't recognize, but your topologies are free to
> make use of them by reading them in the prepare method of Bolts or the open
> method of Spouts"
>
> Is there a way to also use other configurations in the topology itself?
>
> In the JUnit test of my topology I added the following custom
> configuration:
>
> conf.put("insertScanBoltTestData", true);
>
> And when I run my topology I see this (key, value) pair in the Storm
> topology config logs for one of the workers.
>
> My goal is to have my topology look for this custom configuration and only
> inject test data for some of my bolts if insertScanBoltTestData has a value
> of true. This would only be in the case that the topology is under test.
>
> Has anyone done something similar to this?
>
> Pete
>
> --
> Pete Carlson
> Software Developer
> Tetra Concepts LLC
>
|