I am trying to use dependency injection where possible, so as long as I can
get a hook to the command line parameters in a consistent way, I can
configure my injector accordingly.

Thank you all, I'll let you know how it goes.

D.


[image: Mailtrack]
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&;>
Sender
notified by
Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5&;>
14/11/18,
14:16:06

On Mon, 12 Nov 2018 at 08:27, Robert Bradshaw <[email protected]> wrote:

> You could also parameterize your DoFn, with a boolean (or swap out a
> different DoFn altogether) by consulting the options at pipeline
> construction.
>
> On Sun, Nov 11, 2018 at 6:13 PM Juan Carlos Garcia <[email protected]>
> wrote:
>
>> You can use the PipelineOption which can be accessed from within a {@link
>> DoFn} by invoking getPipelineOptions() on the input DoFn.ProcessContext
>> Context object, or the same from the StartBundleContext, and from there
>> you can access to the Runner options you are passing from the command line.
>>
>> JC
>>
>> On Sun, Nov 11, 2018 at 12:23 PM Davide Anastasia <
>> [email protected]> wrote:
>>
>>> Hi,
>>> I am mostly working with Dataflow using Beam, but I mostly develop using
>>> the local runner. However, I am interacting with other google service in
>>> production which I don't want to necessarily interact with during the
>>> development stage.
>>>
>>> I am wondering if there is a way to write something like:
>>>
>>> if (runner == "Dataflow") {
>>>   // do stuff
>>> } else {
>>>   // do nothing
>>> }
>>>
>>> inside my PTransform / DoFn or elsewhere in the code.
>>>
>>> Is there anyway I can fill the "runner" variable in a consistent way?
>>>
>>> Thanks,
>>> D.
>>>
>>
>>
>> --
>>
>> JC
>>
>>

Reply via email to