Hi Everyone,
Some of my thoughts:
1. If we are going to introduce new methods or stages in the lifecycle of a
function such as "open" and "close", I would recommend we follow what we
already have for Pulsar IO sources and Sink so that we are consistent.
2. I am also not a particular fan of the
- Regarding the interface design:
One thing we need to confirm is whether we **don't want old runtime to execute
new function without proper initialization** or not.
If this rule must be followed, then one possible way is we define a separate
`HookFunction` interface which includes `setup`, `pr
Il Mar 6 Lug 2021, 21:30 Neng Lu ha scritto:
> IMHO, The old runtime should not be able to run the new functions.
This is not possible to enforce this because we cannot change old code.
>
>
> New functions require resource initialization via hooks. If the actual
> `setup()` method is not calle
IMHO, The old runtime should not be able to run the new functions.
New functions require resource initialization via hooks. If the actual
`setup()` method is not called (or only a default no-op one is called), then
the function is not properly initialized and there'll be problems if they are
e
So there are two compatibility issues we need to consider here.
1) Old runtime to run new functions.
2) New runtime to run old functions.
Making the methods with default no-op implementation will resolve 1).
Is that correct?
We can use reflection to check if the methods exist or not to solve 2),
I think the reason is for keeping the original `Function` unchanged, so that
existing implemented functions are not affected.
On 2021/07/06 03:34:49 Sijie Guo wrote:
> Thank you for starting the discussion!
>
> I have added this proposal to PIP-86:
> https://github.com/apache/pulsar/wiki/PIP-86
Thank you for starting the discussion!
I have added this proposal to PIP-86:
https://github.com/apache/pulsar/wiki/PIP-86:-Pulsar-Functions:-Preload-and-release-external-resources
I have one question: why do you introduce HookFunction? Why not just add
two default methods to the existing Function
MotivationIt is very useful in many scenarios to provide safe and convenient
capabilities for function39s external resource initialization and release. In
addition to the normal data processing path, it enables functions to use
HookFunction to manage external resources
At present, in order to