Skip to content

Commit

Permalink
[SPARK-8282] [SPARKR] Make number of threads used in RBackend configu…
Browse files Browse the repository at this point in the history
…rable

Read number of threads for RBackend from configuration.

[SPARK-8282] #comment Linking with JIRA

Author: Hossein <[email protected]>

Closes apache#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
  • Loading branch information
falaki authored and Andrew Or committed Jun 10, 2015
1 parent 3811290 commit 30ebf1a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/main/scala/org/apache/spark/api/r/RBackend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)

Expand Down
12 changes: 12 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 30ebf1a

Please sign in to comment.