Github user nyaapa commented on the pull request:

    https://github.com/apache/spark/pull/7345#issuecomment-122390631
  
    What if we try to do some refactoring? 
    1) we need to clean up some old code with ipv4:port hardcoded 
http://pastebin.com/eJvR1sA4
    2) after that we can remove ```localHostNameForURI``` function, I think 
that it was a mistake, because it didn't actually helped and spark 1.4.1 
without previous fix can't work as ipv6 standalone http://pastebin.com/c0n4NKZ8
    3) for 
https://github.com/apache/spark/pull/5424/files#diff-d239aee594001f8391676e1047a0381eR710
 at 816 in ```findLocalInetAddress()``` we need to save hostname ```val 
strippedAddress = InetAddress.getByAddress(addr.getAddress)``` -> ```val 
strippedAddress = InetAddress.getByAddress(addr.getHostName, addr.getAddress)```
    4) at 849 in ```localHostName``` we can write 
    ```
    def localHostName(): String = { 
    
      customHostname.getOrElse({
        val name = localIpAddress.getHostName
        if ( name.indexOf(":") == -1 ) name
        else InetAddresses.toUriString(localIpAddress)
      })
    }
    ```
    5) we can rename ```localIpAddress``` to ```localAddress```
    
    I was going to make a PR in a month, but still don't know how to test it. 
Maybe @bdzimmer can write some tests for this case with hostname instead of ip, 
and add ipv6 cases?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to