diff options
author | Hossein <hossein@databricks.com> | 2015-06-10 13:18:48 -0700 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2015-06-10 13:19:44 -0700 |
commit | 30ebf1a233295539c2455bd838bae7315711e1e2 (patch) | |
tree | 343aee2fe06a428c38f2afedb59b8f197c51cf91 /core | |
parent | 38112905bc3b33f2ae75274afba1c30e116f6e46 (diff) | |
download | spark-30ebf1a233295539c2455bd838bae7315711e1e2.tar.gz spark-30ebf1a233295539c2455bd838bae7315711e1e2.tar.bz2 spark-30ebf1a233295539c2455bd838bae7315711e1e2.zip |
[SPARK-8282] [SPARKR] Make number of threads used in RBackend configurable
Read number of threads for RBackend from configuration.
[SPARK-8282] #comment Linking with JIRA
Author: Hossein <hossein@databricks.com>
Closes #6730 from falaki/SPARK-8282 and squashes the following commits:
33b3d98 [Hossein] Documented new config parameter
70f2a9c [Hossein] Fixing import
ec44225 [Hossein] Read number of threads for RBackend from configuration
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/api/r/RBackend.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/api/r/RBackend.scala b/core/src/main/scala/org/apache/spark/api/r/RBackend.scala index d24c650d37..1a5f2bca26 100644 --- a/core/src/main/scala/org/apache/spark/api/r/RBackend.scala +++ b/core/src/main/scala/org/apache/spark/api/r/RBackend.scala @@ -29,7 +29,7 @@ import io.netty.channel.socket.nio.NioServerSocketChannel import io.netty.handler.codec.LengthFieldBasedFrameDecoder import io.netty.handler.codec.bytes.{ByteArrayDecoder, ByteArrayEncoder} -import org.apache.spark.Logging +import org.apache.spark.{Logging, SparkConf} /** * Netty-based backend server that is used to communicate between R and Java. @@ -41,7 +41,8 @@ private[spark] class RBackend { private[this] var bossGroup: EventLoopGroup = null def init(): Int = { - bossGroup = new NioEventLoopGroup(2) + val conf = new SparkConf() + bossGroup = new NioEventLoopGroup(conf.getInt("spark.r.numRBackendThreads", 2)) val workerGroup = bossGroup val handler = new RBackendHandler(this) |