Skip to content

Commit b221398

Browse files
committed
Move send methods above ask methods
1 parent 15cfd7b commit b221398

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

core/src/main/scala/org/apache/spark/rpc/RpcEnv.scala

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,27 @@ private[spark] abstract class RpcEndpointRef(@transient conf: SparkConf)
290290

291291
def name: String
292292

293+
/**
294+
* Sends a one-way asynchronous message. Fire-and-forget semantics.
295+
*/
296+
def send(message: Any): Unit
297+
298+
/**
299+
* Send a message to the corresponding [[RpcEndpoint.receiveAndReply)]] and return a `Future` to
300+
* receive the reply within a default timeout.
301+
*
302+
* This method only sends the message once and never retries.
303+
*/
304+
def sendWithReply[T: ClassTag](message: Any): Future[T] = sendWithReply(message, defaultTimeout)
305+
306+
/**
307+
* Send a message to the corresponding [[RpcEndpoint.receiveAndReply)]] and return a `Future` to
308+
* receive the reply within the specified timeout.
309+
*
310+
* This method only sends the message once and never retries.
311+
*/
312+
def sendWithReply[T: ClassTag](message: Any, timeout: FiniteDuration): Future[T]
313+
293314
/**
294315
* Send a message to the corresponding [[RpcEndpoint]] and get its result within a default
295316
* timeout, or throw a SparkException if this fails even after the default number of retries.
@@ -344,27 +365,6 @@ private[spark] abstract class RpcEndpointRef(@transient conf: SparkConf)
344365
s"Error sending message [message = $message]", lastException)
345366
}
346367

347-
/**
348-
* Sends a one-way asynchronous message. Fire-and-forget semantics.
349-
*/
350-
def send(message: Any): Unit
351-
352-
/**
353-
* Send a message to the corresponding [[RpcEndpoint.receiveAndReply)]] and return a `Future` to
354-
* receive the reply within a default timeout.
355-
*
356-
* This method only sends the message once and never retries.
357-
*/
358-
def sendWithReply[T: ClassTag](message: Any): Future[T] = sendWithReply(message, defaultTimeout)
359-
360-
/**
361-
* Send a message to the corresponding [[RpcEndpoint.receiveAndReply)]] and return a `Future` to
362-
* receive the reply within the specified timeout.
363-
*
364-
* This method only sends the message once and never retries.
365-
*/
366-
def sendWithReply[T: ClassTag](message: Any, timeout: FiniteDuration): Future[T]
367-
368368
def toURI: URI
369369
}
370370

0 commit comments

Comments
 (0)