aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/scala/org/apache/spark/api/r/RBackend.scala5
-rw-r--r--docs/configuration.md12
2 files changed, 15 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)
diff --git a/docs/configuration.md b/docs/configuration.md
index 3960e7e78b..95a322f79b 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -1495,6 +1495,18 @@ Apart from these, the following properties are also available, and may be useful
</tr>
</table>
+#### SparkR
+<table class="table">
+<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
+<tr>
+ <td><code>spark.r.numRBackendThreads</code></td>
+ <td>2</td>
+ <td>
+ Number of threads used by RBackend to handle RPC calls from SparkR package.
+ </td>
+</tr>
+</table>
+
#### Cluster Managers
Each cluster manager in Spark has additional configuration options. Configurations
can be found on the pages for each mode: