Github user jerryshao commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17342#discussion_r106842764
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -2767,3 +2767,24 @@ private[spark] class CircularBuffer(sizeInBytes: Int 
= 10240) extends java.io.Ou
         new String(nonCircularBuffer, StandardCharsets.UTF_8)
       }
     }
    +
    +
    +/**
    + * Factory for URL stream handlers. It relies on 'protocol' to choose the 
appropriate
    + * UrlStreamHandlerFactory to create URLStreamHandler. Adding new 'if' 
branches in
    + * 'createURLStreamHandler' like 'hdfsHandler' to support more protocols.
    + */
    +private[spark] class SparkUrlStreamHandlerFactory extends 
URLStreamHandlerFactory {
    +  private var hdfsHandler : URLStreamHandler = _
    +
    +  def createURLStreamHandler(protocol: String): URLStreamHandler = {
    +    if (protocol.compareToIgnoreCase("hdfs") == 0) {
    +      if (hdfsHandler == null) {
    +        hdfsHandler = new 
FsUrlStreamHandlerFactory().createURLStreamHandler(protocol)
    --- End diff --
    
    I think you should call `public FsUrlStreamHandlerFactory(Configuration 
conf) ` this constructor, and use `Configuration` created by `SparkHadoopUtils`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to