Package org.apache.spark.ml.param.shared
Interface HasParallelism
- All Superinterfaces:
- Identifiable,- Params,- Serializable
- All Known Implementing Classes:
- CrossValidator,- OneVsRest,- TrainValidationSplit
Trait to define a level of parallelism for algorithms that are able to use
 multithreaded execution, and provide a thread-pool based execution context.
- 
Method SummaryModifier and TypeMethodDescriptionscala.concurrent.ExecutionContextCreate a new execution context with a thread-pool that has a maximum number of threads set to the value ofparallelism().intThe number of threads to use when running parallel algorithms.Methods inherited from interface org.apache.spark.ml.util.IdentifiabletoString, uidMethods inherited from interface org.apache.spark.ml.param.Paramsclear, copy, copyValues, defaultCopy, defaultParamMap, estimateMatadataSize, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
- 
Method Details- 
getExecutionContextscala.concurrent.ExecutionContext getExecutionContext()Create a new execution context with a thread-pool that has a maximum number of threads set to the value ofparallelism(). If this param is set to 1, a same-thread executor will be used to run in serial.- Returns:
- (undocumented)
 
- 
getParallelismint getParallelism()
- 
parallelismIntParam parallelism()The number of threads to use when running parallel algorithms. Default is 1 for serial execution- Returns:
- (undocumented)
 
 
-