title: How can I share a binary among tasks?
body: <p>Let's say that I have some kind of binary that I want to share among all tasks (containing a trained ML model, for instance). How can I do so using the <code>DataStream</code> API?</p>
  
  <p>While I understand there's the concept of <a href="https://ci.apache.org/projects/flink/flink-docs-stable/dev/batch/#broadcast-variables" rel="nofollow noreferrer">broadcast variables</a> in the <code>DataSet</code> API, it seems there is no equivalent for streaming.</p>
  
  <p>I thought maybe I could have a custom data source that emits a single value (the <code>Serializable</code> I want to share, which is captured by Flink inside a closure) and registers it as Queryable State using a <code>ValueStateDescriptor</code>. Would this be a viable option?</p>
  
  <p>I'm looking for something similar to <a href="https://spark.apache.org/docs/latest/rdd-programming-guide.html#broadcast-variables" rel="nofollow noreferrer">Spark's shared variables</a> so that I can allow "clients" of the stuff I'm building to use a given shared variable inside the lambdas they pass to "my" operators (that essentially are an abstraction on top of Flink and other engines).</p>
  
  <p><strong>Edit:</strong> queryable state is not an option given that it must be keyed.</p>