Reputation: 7940
In FoDn we have @Setup which is perfect to initialize cross bundle resources. Is this shared among CPUs as well? In other words, do we need to perform management of resources statically for this to be shared among all CPUs?
Upvotes: 1
Views: 312
Reputation: 5104
@Setup
is called per DoFn instance, which is always local to a single thread. If you want to share a resource across the process you can manage this manually with static/global variables. (To do so across processes would probably require some kind of file locking.)
Upvotes: 1