Hi Tony,
not having a proper equals() method might work for a keyBy()
(partitioning operation) but it can lead to unexpected side effects when
dealing with state. If not now, then maybe in the future. For example,
heap-based state uses a hash table data structures such that your key
might never be found again. I would recommend to wrap your POJO into
another class that implements a proper hashCode/equals.
Regards,
Timo
Am 2/6/18 um 4:16 AM schrieb Tony Wei:
Hi all,
I have defined a POJO class that override Object#hashCode and used it
in keyBy().
The pipeline looks good (i.e. no exception that told me it is
UNSUPPORTED key types), but I'm afraid that it will leads to a problem
that elements that I think have the same key will not get the same
state because I didn't override Object#equals.
Is it necessary that POJO key type overrides Object#equals? Or
PojoTypeInfo didn't rely on MyClass#equals? Or keyBy() didn't rely on
equals?
Thank you very much.
Best Regards,
Tony Wei