Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix review comments
  • Loading branch information
weiqingy committed Apr 20, 2017
commit 08810f2865c222b50118ac4b9ca31e6d151d2c94
5 changes: 3 additions & 2 deletions core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,7 @@ private[spark] class CircularBuffer(sizeInBytes: Int = 10240) extends java.io.Ou

/**
* Factory for URL stream handlers. It relies on 'protocol' to choose the appropriate
* UrlStreamHandlerFactory to create URLStreamHandler. Adding new 'if' branches in
* UrlStreamHandlerFactory to create URLStreamHandler. Add new 'if' branches in
* 'createURLStreamHandler' like 'hdfsHandler' to support more protocols.
*/
private[spark] class SparkUrlStreamHandlerFactory extends URLStreamHandlerFactory {
Expand All @@ -2793,7 +2793,8 @@ private[spark] class SparkUrlStreamHandlerFactory extends URLStreamHandlerFactor
def createURLStreamHandler(protocol: String): URLStreamHandler = {
if (protocol.compareToIgnoreCase("hdfs") == 0) {
if (hdfsHandler == null) {
hdfsHandler = new FsUrlStreamHandlerFactory().createURLStreamHandler(protocol)
hdfsHandler = new FsUrlStreamHandlerFactory(SparkHadoopUtil.get.conf)
.createURLStreamHandler(protocol)
}
hdfsHandler
} else {
Expand Down