You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by Eron Wright <ew...@live.com> on 2017/01/05 03:40:40 UTC

CheckpointedFunction applicability?

Hello!   

The `CheckpointedFunction` interface was introduced to provide user functions with a context for partitioned state storage.   This works for user functions that are provided directly to the operator (assuming it extends from `AbstractUdfStreamOperator`).   However, I see that some operators wrap the user function in an internal function (e.g. `WrappingFunction`,  `InternalWindowFunction`).   This defeats the callbacks on `CheckpointedFunction` because those wrappers don’t implement `CheckpointedFunction`.  Is this by design or a bug?

For example, the user function passed to `WindowedStream::apply` will get callbacks for `RichFunction` but not for `CheckpointedFunction`.

To fix it, the wrapper would assumedly implement `CheckpointedFunction` and contain logic similar to that found in `AbstractUdfStreamOperator` (including the handling of `ListCheckpointed`).

Thanks
Eron

Re: CheckpointedFunction applicability?

Posted by Eron Wright <ew...@live.com>.
Opened FLINK-5416 (unassigned).


________________________________
From: Stefan Richter <s....@data-artisans.com>
Sent: Thursday, January 5, 2017 5:54:30 AM
To: dev@flink.apache.org
Subject: Re: CheckpointedFunction applicability?

Hi,

you are correct, the wrappers are lacking callbacks on CheckpointedFunction. This is not the intended design and should be added.

Best,
Stefan


> Am 05.01.2017 um 04:40 schrieb Eron Wright <ew...@live.com>:
>
> Hello!
>
> The `CheckpointedFunction` interface was introduced to provide user functions with a context for partitioned state storage.   This works for user functions that are provided directly to the operator (assuming it extends from `AbstractUdfStreamOperator`).   However, I see that some operators wrap the user function in an internal function (e.g. `WrappingFunction`,  `InternalWindowFunction`).   This defeats the callbacks on `CheckpointedFunction` because those wrappers don’t implement `CheckpointedFunction`.  Is this by design or a bug?
>
> For example, the user function passed to `WindowedStream::apply` will get callbacks for `RichFunction` but not for `CheckpointedFunction`.
>
> To fix it, the wrapper would assumedly implement `CheckpointedFunction` and contain logic similar to that found in `AbstractUdfStreamOperator` (including the handling of `ListCheckpointed`).
>
> Thanks
> Eron


Re: CheckpointedFunction applicability?

Posted by Stefan Richter <s....@data-artisans.com>.
Hi,

you are correct, the wrappers are lacking callbacks on CheckpointedFunction. This is not the intended design and should be added.

Best,
Stefan


> Am 05.01.2017 um 04:40 schrieb Eron Wright <ew...@live.com>:
> 
> Hello!   
> 
> The `CheckpointedFunction` interface was introduced to provide user functions with a context for partitioned state storage.   This works for user functions that are provided directly to the operator (assuming it extends from `AbstractUdfStreamOperator`).   However, I see that some operators wrap the user function in an internal function (e.g. `WrappingFunction`,  `InternalWindowFunction`).   This defeats the callbacks on `CheckpointedFunction` because those wrappers don’t implement `CheckpointedFunction`.  Is this by design or a bug?
> 
> For example, the user function passed to `WindowedStream::apply` will get callbacks for `RichFunction` but not for `CheckpointedFunction`.
> 
> To fix it, the wrapper would assumedly implement `CheckpointedFunction` and contain logic similar to that found in `AbstractUdfStreamOperator` (including the handling of `ListCheckpointed`).
> 
> Thanks
> Eron