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

    https://github.com/apache/spark/pull/1777#discussion_r15796941
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -1331,4 +1331,49 @@ private[spark] object Utils extends Logging {
           .map { case (k, v) => s"-D$k=$v" }
       }
     
    +  /**
    +   * Attempt to start a service on the given port, or fail after a number 
of attempts.
    +   * Each subsequent attempt uses 1 + the port used in the previous 
attempt.
    +   *
    +   * @param startPort The initial port to start the service on.
    +   * @param maxRetries Maximum number of retries to attempt.
    +   *                   A value of 3 means attempting ports n, n+1, n+2, 
and n+3, for example.
    +   * @param startService Function to start service on a given port.
    +   *                     This is expected to throw java.net.BindException 
on port collision.
    +   * @throws SparkException When unable to start the service after a given 
number of attempts
    +   */
    +  def startServiceOnPort[T](
    +      startPort: Int,
    +      startService: Int => (T, Int),
    +      serviceName: String = "",
    +      maxRetries: Int = 3): (T, Int) = {
    --- End diff --
    
    sounds good


---
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