what's the difference of `RunAsync` and `CallAsync` in RPC

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

what's the difference of `RunAsync` and `CallAsync` in RPC

Benchao Li
Hi all,

I recently encountered a question while reading the Flink code.

In my understanding, `RunAsync` and `CallAsync` are classes for local
invocations to `AkkaRpcActor`, and should only be used locally.

However, `CallAsync` implements `Serializable`, but  `RunAsync` not. And
`AkkaRpcActor` will check the callable in  `CallAsync` and runnable in
`Serializable` if it's null or not.

My question is:
1, if we just use `RunAsync` and `CallAsync` locally, why `CallAsync`
implements `Serializable` ?
2, if we need they are serializable, why `RunAsync` does not implements
`Serializable`. Did we just forget that?

I have created a jira ticket:
https://issues.apache.org/jira/browse/FLINK-11655, and would like to fix
that if someone would guide me here.

--

Benchao Li
School of Electronics Engineering and Computer Science, Peking University
Tel:+86-15650713730
Email: [hidden email]; [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: what's the difference of `RunAsync` and `CallAsync` in RPC

Till Rohrmann
Hi Benchao,

I think this is an oversight. Since both messages should only be used
locally, neither of them needs to implement the Serializable interface.
Let's continue the discussion in the JIRA issue.

Cheers,
Till

On Tue, Feb 19, 2019 at 8:31 AM Benchao Li <[hidden email]> wrote:

> Hi all,
>
> I recently encountered a question while reading the Flink code.
>
> In my understanding, `RunAsync` and `CallAsync` are classes for local
> invocations to `AkkaRpcActor`, and should only be used locally.
>
> However, `CallAsync` implements `Serializable`, but  `RunAsync` not. And
> `AkkaRpcActor` will check the callable in  `CallAsync` and runnable in
> `Serializable` if it's null or not.
>
> My question is:
> 1, if we just use `RunAsync` and `CallAsync` locally, why `CallAsync`
> implements `Serializable` ?
> 2, if we need they are serializable, why `RunAsync` does not implements
> `Serializable`. Did we just forget that?
>
> I have created a jira ticket:
> https://issues.apache.org/jira/browse/FLINK-11655, and would like to fix
> that if someone would guide me here.
>
> --
>
> Benchao Li
> School of Electronics Engineering and Computer Science, Peking University
> Tel:+86-15650713730
> Email: [hidden email]; [hidden email]
>