@@ -70,15 +70,15 @@ private[spark] abstract class RpcEnv(conf: SparkConf) {
7070 def setupThreadSafeEndpoint (name : String , endpoint : RpcEndpoint ): RpcEndpointRef
7171
7272 /**
73- * Retrieve the [[RpcEndpointRef ]] represented by `url ` asynchronously.
73+ * Retrieve the [[RpcEndpointRef ]] represented by `uri ` asynchronously.
7474 */
75- def asyncSetupEndpointRefByUrl ( url : String ): Future [RpcEndpointRef ]
75+ def asyncSetupEndpointRefByURI ( uri : String ): Future [RpcEndpointRef ]
7676
7777 /**
78- * Retrieve the [[RpcEndpointRef ]] represented by `url `. This is a blocking action.
78+ * Retrieve the [[RpcEndpointRef ]] represented by `uri `. This is a blocking action.
7979 */
80- def setupEndpointRefByUrl ( url : String ): RpcEndpointRef = {
81- Await .result(asyncSetupEndpointRefByUrl(url ), defaultLookupTimeout)
80+ def setupEndpointRefByURI ( uri : String ): RpcEndpointRef = {
81+ Await .result(asyncSetupEndpointRefByURI(uri ), defaultLookupTimeout)
8282 }
8383
8484 /**
@@ -87,7 +87,7 @@ private[spark] abstract class RpcEnv(conf: SparkConf) {
8787 */
8888 def asyncSetupEndpointRef (
8989 systemName : String , address : RpcAddress , endpointName : String ): Future [RpcEndpointRef ] = {
90- asyncSetupEndpointRefByUrl (uriOf(systemName, address, endpointName))
90+ asyncSetupEndpointRefByURI (uriOf(systemName, address, endpointName))
9191 }
9292
9393 /**
@@ -96,7 +96,7 @@ private[spark] abstract class RpcEnv(conf: SparkConf) {
9696 */
9797 def setupEndpointRef (
9898 systemName : String , address : RpcAddress , endpointName : String ): RpcEndpointRef = {
99- setupEndpointRefByUrl (uriOf(systemName, address, endpointName))
99+ setupEndpointRefByURI (uriOf(systemName, address, endpointName))
100100 }
101101
102102 /**
@@ -381,12 +381,18 @@ private[spark] case class RpcAddress(host: String, port: Int) {
381381
382382private [spark] object RpcAddress {
383383
384+ /**
385+ * Return the [[RpcAddress ]] represented by `uri`.
386+ */
387+ def fromURI (uri : URI ): RpcAddress = {
388+ RpcAddress (uri.getHost, uri.getPort)
389+ }
390+
384391 /**
385392 * Return the [[RpcAddress ]] represented by `uri`.
386393 */
387394 def fromURIString (uri : String ): RpcAddress = {
388- val u = new java.net.URI (uri)
389- RpcAddress (u.getHost, u.getPort)
395+ fromURI(new java.net.URI (uri))
390396 }
391397
392398 def fromSparkURL (sparkUrl : String ): RpcAddress = {
0 commit comments