-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-6490][Core] Add spark.rpc.* and deprecate spark.akka.* #5595
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,9 @@ | |
|
||
package org.apache.spark.util | ||
|
||
import scala.concurrent.duration._ | ||
import scala.language.postfixOps | ||
|
||
import org.apache.spark.{SparkEnv, SparkConf} | ||
import org.apache.spark.rpc.{RpcAddress, RpcEndpointRef, RpcEnv} | ||
|
||
|
@@ -32,4 +35,24 @@ object RpcUtils { | |
Utils.checkHost(driverHost, "Expected hostname") | ||
rpcEnv.setupEndpointRef(driverActorSystemName, RpcAddress(driverHost, driverPort), name) | ||
} | ||
|
||
/** Returns the configured number of times to retry connecting */ | ||
def numRetries(conf: SparkConf): Int = { | ||
conf.getInt("spark.rpc.num.retries", 3) | ||
} | ||
|
||
/** Returns the configured number of milliseconds to wait on each retry */ | ||
def retryWaitMs(conf: SparkConf): Long = { | ||
conf.getLong("spark.rpc.retry.wait", 3000) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we're here, could you use the new API:
Similar in other methods in this file. |
||
} | ||
|
||
/** Returns the default Spark timeout to use for Rpc ask operations. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rpc -> RPC |
||
def askTimeout(conf: SparkConf): FiniteDuration = { | ||
conf.getLong("spark.rpc.askTimeout", 30) seconds | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should these be set to the default network timeout? same for lookupTimeout There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So use spark.network.timeout if it presents, but still use the default value "30s" (or 120s)? Such as conf.getTimeAsSeconds("spark.rpc.askTimeout", conf.get("spark.network.timeout", "30s")) seconds |
||
} | ||
|
||
/** Returns the default Spark timeout to use for Rpc remote endpoint lookup. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rpc -> RPC |
||
def lookupTimeout(conf: SparkConf): FiniteDuration = { | ||
conf.getLong("spark.rpc.lookupTimeout", 30) seconds | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should do spark.rpc.numRetries instead (you might need to translate this to akka.num.retries if we pass this back to akka)