title: Sharing Zookeeper configuration on multiple Spark Executors
body: <p>I have a configuration information written in Zookeeper. I'm using Apache Curator to read the configuration(If there is a better solution for reading it, i'm happy to use it) with Curator Watcher so if the configuration is changed in Zookeeper, i'll receive the new one. I'm using this configuration in Spark. How can I share it to all spark executors of the same application?</p>
  
  <p>Thank you!</p>
  
  <p>LE:</p>
  
  <p>Thank you Dikei,</p>
  
  <p>In the following code, where would you do the watcher implementation? I'm new to spark and I'm not exactly sure what goes to each worker.</p>
  
  <p>Thank you!</p>
  
  <pre><code>final JavaDStream&lt;ElementMessage&gt; nodeMessageStream = mapWithStateDistinctAndFiltered.flatMap(pair -&gt; pair._2.buildElementMessages())
              .filter(f -&gt; f != null);
  
      nodeMessageStream.foreachRDD(rdd -&gt; {
          rdd.foreachPartition(r -&gt; {
              final ElementRecordRestClient rest = new ElementRecordRestClient(
                      startProps.getProperty(InputPropertyKey.WEPAPP_URL.toString()));
              r.forEachRemaining(message -&gt; {
                  rest.createObject(message.toElementRecord());
              });
          });
      });
  </code></pre>