Ensure that checkOutputSpecs does nothing
Make getSparkContext synchronized - multiple threads might access this.