[ 
https://issues.apache.org/jira/browse/FLINK-11825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16785550#comment-16785550
 ] 

Andrey Zagrebin commented on FLINK-11825:
-----------------------------------------

[~fhueske], thanks for creating the issue, I agree we need to change it.

Although, I am not sure we can already easily rename or drop the TTL specific 
TimeCharacteristic class because it might break the existing user code as 
feature has been already released.

We could try to deprecate it and its setter method in favour of another setter 
which uses the standard TimeCharacteristic. The TTL specific TimeCharacteristic 
could be converted into the standard TimeCharacteristic in its deprecated 
setter method.

This would allow to write new user code with the standard TimeCharacteristic.

The rest of the internal code should use only the standard TimeCharacteristic 
and throw an exception for any unsupported values as you said.

[~klion26], feel free to work on this issue, I will be happy to help with the 
review.

> Resolve name clash of StateTTL TimeCharacteristic class
> -------------------------------------------------------
>
>                 Key: FLINK-11825
>                 URL: https://issues.apache.org/jira/browse/FLINK-11825
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / State Backends
>    Affects Versions: 1.7.2
>            Reporter: Fabian Hueske
>            Priority: Major
>
> The StateTTL feature introduced the class 
> \{{org.apache.flink.api.common.state.TimeCharacteristic}} which clashes with 
> \{{org.apache.flink.streaming.api.TimeCharacteristic}}. 
> This is a problem for two reasons:
> 1. Users get confused because the mistakenly import 
> \{{org.apache.flink.api.common.state.TimeCharacteristic}}.
> 2. When using the StateTTL feature, users need to spell out the package name 
> for \{{org.apache.flink.api.common.state.TimeCharacteristic}} because the 
> other class is most likely already imported.
> Since \{{org.apache.flink.streaming.api.TimeCharacteristic}} is one of the 
> most used classes of the DataStream API, we should make sure that users can 
> use it without import problems.
> These error are hard to spot and confusing for many users. 
> I see two ways to resolve the issue:
> 1. drop \{{org.apache.flink.api.common.state.TimeCharacteristic}} and use 
> \{{org.apache.flink.streaming.api.TimeCharacteristic}} throwing an exception 
> if an incorrect characteristic is used.
> 2. rename the class \{{org.apache.flink.api.common.state.TimeCharacteristic}} 
> to some other name.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to