Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/9917#discussion_r45806519
--- Diff:
network/common/src/main/java/org/apache/spark/network/server/RpcHandler.java ---
@@ -48,10 +54,40 @@ public abstract void receive(
public abstract StreamManager getStreamManager();
/**
+ * Receives an RPC message that does not expect a reply. The default
implementation will
+ * call "{@link receive(TransportClient, byte[], RpcResponseCallback}"
and log a warning if
+ * any of the callback methods are called.
+ *
+ * @param client A channel client which enables the handler to make
requests back to the sender
+ * of this RPC. This will always be the exact same object
for a particular channel.
+ * @param message The serialized bytes of the RPC.
+ */
+ public void receive(TransportClient client, byte[] message) {
+ receive(client, message, ONE_WAY_CALLBACK);
+ }
+
+ /**
* Invoked when the connection associated with the given client has been
invalidated.
* No further requests will come from this client.
*/
public void connectionTerminated(TransportClient client) { }
public void exceptionCaught(Throwable cause, TransportClient client) { }
+
+ private static class OneWayRpcCallback implements RpcResponseCallback {
+
+ private final Logger logger =
LoggerFactory.getLogger(OneWayRpcCallback.class);
+
+ @Override
+ public void onSuccess(byte[] response) {
+ logger.warn("Response provided for one-way RPC.");
--- End diff --
isn't this going to be really noisy for non-netty `RpcHandler`s?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]