File tree Expand file tree Collapse file tree 1 file changed +6
-17
lines changed
sql/core/src/main/scala/org/apache/spark/sql/internal Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -194,24 +194,13 @@ private[sql] class SharedState(
194194}
195195
196196object SharedState extends Logging {
197- @ volatile private var factory : Option [FsUrlStreamHandlerFactory ] = None
198- private lazy val defaultFactory = new FsUrlStreamHandlerFactory ()
199197 private def setFsUrlStreamHandlerFactory (conf : SparkConf ): Unit = {
200- factory match {
201- case Some (_) =>
202- logWarning(" FsUrlStreamHandlerFactory has been already initialized, " +
203- " so it can not be modified" )
204- case None => synchronized {
205- try {
206- if (conf.get(DEFAULT_URL_STREAM_HANDLER_FACTORY_ENABLED )) {
207- URL .setURLStreamHandlerFactory(defaultFactory)
208- factory = Some (defaultFactory)
209- }
210- } catch {
211- case e : Error =>
212- logWarning(" URL.setURLStreamHandlerFactory failed to set " +
213- " FsUrlStreamHandlerFactory" , e)
214- }
198+ if (conf.get(DEFAULT_URL_STREAM_HANDLER_FACTORY_ENABLED )) {
199+ try {
200+ URL .setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory ())
201+ } catch {
202+ case _ : Error =>
203+ logWarning(" URL.setURLStreamHandlerFactory failed to set FsUrlStreamHandlerFactory" )
215204 }
216205 }
217206 }
You can’t perform that action at this time.
0 commit comments