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

    https://github.com/apache/spark/pull/16774#discussion_r110980824
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/tuning/ValidatorParams.scala ---
    @@ -67,6 +71,39 @@ private[ml] trait ValidatorParams extends HasSeed with 
Params {
       /** @group getParam */
       def getEvaluator: Evaluator = $(evaluator)
     
    +  /**
    +   * param to control the number of models evaluated in parallel
    +   * Default: 1
    +   *
    +   * @group param
    +   */
    +  val numParallelEval: IntParam = new IntParam(this, "numParallelEval",
    +    "max number of models to evaluate in parallel, 1 for serial 
evaluation",
    +    ParamValidators.gtEq(1))
    +
    +  /** @group getParam */
    +  def getNumParallelEval: Int = $(numParallelEval)
    +
    +  /**
    +   * Creates a execution service to be used for validation, defaults to a 
thread-pool with
    +   * size of `numParallelEval`
    +   */
    +  protected var executorServiceFactory: (Int) => ExecutorService = {
    +    (requestedMaxThreads: Int) => ThreadUtils.newDaemonCachedThreadPool(
    +      s"${this.getClass.getSimpleName}-thread-pool", requestedMaxThreads)
    +  }
    +
    +  /**
    +   * Sets a function to get an execution service to be used for validation
    +   *
    +   * @param getExecutorService function to get an ExecutorService given a 
requestedMaxThread size
    +   */
    +  @Experimental
    +  @InterfaceStability.Unstable
    +  def setExecutorService(getExecutorService: (Int) => ExecutorService): 
Unit = {
    --- End diff --
    
    I think you are probably right about the Java thing, I'll test that out.
    
    >custom one can be set with this method (advanced usage). If set, the 
custom one will override.
    
    That's how this works, the executor service can be overridden and set any 
size thread pool, it is just passed the `numParallelEval` param for convenience 
in case it wants to use it.


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