[
https://issues.apache.org/jira/browse/KAFKA-12313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17301917#comment-17301917
]
A. Sophie Blee-Goldman commented on KAFKA-12313:
------------------------------------------------
Ah, I didn't notice (or forgot ;)) that we had started throwing an
IllegalArgumentException instead of setting it to MAX_VALUE when windowSize =
null during KIP-659. I guess we don't have to worry about that here
In that case we should also do something similar for the innerClass: ie
if (innerClassDeserializer != null && configInnerClassDeserializer != null) {
throw new IllegalArgumentException("Inner class deserializer should not be set
in both the time windowed deserializer constructor and the
windowed.deserializer.inner.class config");
}
But that still leaves the door open for users to _only_ set the config for both
windowSize & innerClassSerde, which is what we want to discourage. That was
what I was trying to propose in item #3 – that the configs should only be used
for the console consumer, while for use within Kafka Streams the Serde should
always be instantiated directly. Does that make sense?
Here's what I'm thinking:
We deprecate both existing configs, and replace them with a single
windowed.deserializer.inner.class config. Since we technically only need this
config for the console consumer, but not the producer, we can actually just
make the config accept a deserializer class directly (rather than the serde
class). That way it seems especially obvious that this config is not intended
for use within Kafka Streams, since it's just a deserializer.
WDYT?
Also, Re: your question in #5: you're asking if we should ensure that both the
innerClassDeserializer and the windowSize parameters are passed in to the
configs, right? If so, then yes, that makes sense to me.
> Consider deprecating the default.windowed.serde.inner.class configs
> -------------------------------------------------------------------
>
> Key: KAFKA-12313
> URL: https://issues.apache.org/jira/browse/KAFKA-12313
> Project: Kafka
> Issue Type: Improvement
> Components: streams
> Reporter: A. Sophie Blee-Goldman
> Assignee: Sagar Rao
> Priority: Major
> Labels: needs-kip
> Fix For: 3.0.0
>
>
> During the discussion of KIP-659 we discussed whether it made sense to have a
> "default" class for the serdes of windowed inner classes across Streams.
> Using these configs instead of specifying an actual Serde object can lead to
> subtle bugs, since the WindowedDeserializer requires a windowSize in addition
> to the inner class. If the default constructor is invoked, as it will be when
> falling back on the config, this windowSize defaults to MAX_VALUE.
> If the downstream program doesn't care about the window end time in the
> output, then this can go unnoticed and technically there is no problem. But
> if anything does depend on the end time, or the user just wants to manually
> read the output for testing purposes, then the MAX_VALUE will result in a
> garbage timestamp.
> We should consider whether the convenience of specifying a config instead of
> instantiating a Serde in each operator is really worth the risk of a user
> accidentally failing to specify a windowSize
--
This message was sent by Atlassian Jira
(v8.3.4#803005)