You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2017/10/01 19:33:15 UTC

[GitHub] spark pull request #19408: [SPARK-22180][CORE] Allow IPv6 address in org.apa...

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

    https://github.com/apache/spark/pull/19408#discussion_r142038575
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -981,7 +981,13 @@ private[spark] object Utils extends Logging {
           return cached
         }
     
    -    val indx: Int = hostPort.lastIndexOf(':')
    +    val indx: Int =
    +      // Interpret hostPort as literal IPv6 address if it contains two ore more colons
    +      // scalastyle:off SingleSpaceBetweenRParenAndLCurlyBrace
    +      if (hostPort.matches("(([0-9a-f]*):([0-9a-f]*)){2,}")) -1
    +      // Else last colon defines start of port definition
    +      else hostPort.lastIndexOf(':')
    --- End diff --
    
    Final nit, use braces for both parts of the if-else


---

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