dongjoon-hyun commented on code in PR #38995:
URL: https://github.com/apache/spark/pull/38995#discussion_r1044329880


##########
core/src/main/scala/org/apache/spark/rpc/RpcEndpoint.scala:
##########
@@ -153,12 +153,25 @@ private[spark] trait ThreadSafeRpcEndpoint extends 
RpcEndpoint
 private[spark] trait IsolatedRpcEndpoint extends RpcEndpoint {
 
   /**
-   * How many threads to use for delivering messages. By default, use a single 
thread.
+   * How many threads to use for delivering messages.
    *
    * Note that requesting more than one thread means that the endpoint should 
be able to handle
    * messages arriving from many threads at once, and all the things that 
entails (including
    * messages being delivered to the endpoint out of order).
    */
-  def threadCount(): Int = 1
+  def threadCount(): Int
+
+}
+
+/**
+ * An endpoint that uses a dedicated thread pool for delivering messages and
+ * ensured to be thread-safe.
+ */
+private[spark] trait IsolatedThreadSafeRpcEndpoint extends IsolatedRpcEndpoint 
{
+
+  /**
+   * Limit the threadCount to 1 so that messages are ensured to be handled in 
a thread-safe way.
+   */
+  final def threadCount(): Int = 1

Review Comment:
   According to the PR description, this `final def` is the main contribution, 
@Ngone51 ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to