static and volatile are unrelated. Being volatile doesn't change the properties of the variable with respect to being static.
On Wed, Jun 7, 2017 at 4:01 PM Chang Chen <baibaic...@gmail.com> wrote: > Static variable will be initialized in worker node JVM, will not be > serialized from master. But how about static volatile variable? > > Recently I read the beam spark runner code, and i find that they use > static volatile Broadcast variable. See > https://github.com/apache/beam/blob/master/runners/spark/src/main/java/org/apache/beam/runners/spark/util/GlobalWatermarkHolder.java#L46 > > It confused me a lot, is static volatile variable different with static > variable in the closure? >