'How to broadcast objects to Slot in Flink

I'm working on a word segmentation project in Flink, how can I send a jieba object created in the main method to each slot.



Solution 1:[1]

If the jieba object is serializable, then you can pass it to the constructor of some custom function and save it in a non-transient field. When the function is serialized & distributed by Flink to each Task Manager, the object will be deserialized when the function is instantiated.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kkrugler