Now I can find to ways:
1. Prepare the executor before any action are taken. The drawback is if we add new executors, following job will fail.
sc.parallelize(Seq(1 to 10000), 10000).foreach(setupExecutor)
2. Change StaticParser to a class, and make an instance then ship it from driver to executors.
val shippedParser = new StaticParser().init(dev)