Yea, this is a common issue with serializable anonymous inner classes in
general. It would be nice if Beam Java could have an overarching solution
to limiting the closure to things actually touched.


On Wed, Apr 11, 2018 at 10:30 AM Raghu Angadi <> wrote:

> I noticed it too while adding KafkaIO support for Nexmark (this was in
> parallel to another PR for KafkaIO that got merged recently).
> The anonymous inner class for DoFn is not serializable. I moved it  to a
> static class in my branch, but didn't test it yet :
> .
> One issue with Nexmark benchmarks with sources like Pubsub and KafkaIO is
> how the tests are terminated...
> Raghu.
> On Wed, Apr 11, 2018 at 9:54 AM Alexey Romanenko <>
> wrote:
>> Hi all,
>> For the moment, I'm working on BEAM-4048
>> <> to add Kafka
>> source/sink support with different modes to Nexmark, like it has for PubSub
>> (*SUBSCRIBE_ONLY, PUBLISH_ONLY* and *COMBINED*). It seems that the code
>> will be similar to what we have for PubSub so I wanted to do some
>> refactoring and reuse already existed code for Kafka. So, to make sure that
>> nothing will be broken after this refactoring, I want to run Nexmark with
>> PubSub source/sink in different modes before and after.
>> I tried to do this with PubSub emulator but I have very strange issue
>> related to pipeline serialisation - it tries to serialise
>> *NexmarkLauncher*, see this output
>> <>
>> Could anyone point me out if I do something wrong running this Nexmark
>> pipeline and how properly to do it with PubSub as source/sink?
>> WBR,
>> Alexey

Reply via email to