yanghua commented on a change in pull request #8459: [FLINK-12476] [State TTL] 
Consider setting a default background cleanup strategy in StateTtlConfig
URL: https://github.com/apache/flink/pull/8459#discussion_r285879213
 
 

 ##########
 File path: 
flink-core/src/main/java/org/apache/flink/api/common/state/StateTtlConfig.java
 ##########
 @@ -376,39 +391,57 @@ public StateTtlConfig build() {
                        private static final long serialVersionUID = 
1373998465131443873L;
                }
 
-               final EnumMap<Strategies, CleanupStrategy> strategies = new 
EnumMap<>(Strategies.class);
+               private final EnumMap<Strategies, CleanupStrategy> strategies = 
new EnumMap<>(Strategies.class);
 
-               public void activate(Strategies strategy) {
+               private void activate(Strategies strategy) {
                        activate(strategy, EMPTY_STRATEGY);
                }
 
-               public void activate(Strategies strategy, CleanupStrategy 
config) {
+               private void activate(Strategies strategy, CleanupStrategy 
config) {
                        strategies.put(strategy, config);
                }
 
                public boolean inFullSnapshot() {
                        return 
strategies.containsKey(Strategies.FULL_STATE_SCAN_SNAPSHOT);
 
 Review comment:
   I think this change will cause bugs(full snapshot and incremental cleanup 
has their own keys), there are many test error, such as:
   
   ```
   [ERROR]   
HeapAsyncSnapshotTtlStateTest>TtlStateTestBase.testMultipleKeysWithSnapshotCleanup:325->TtlStateTestBase.testMultipleStateIds:388
 Expired state should be unavailable expected:<null> but was:<9>
   04:50:53.740 [ERROR]   
HeapAsyncSnapshotTtlStateTest>TtlStateTestBase.testMultipleKeysWithSnapshotCleanup:325->TtlStateTestBase.testMultipleStateIds:388
 Expired state should be unavailable expected:<[]> but was:<[1, 4]>
   04:50:53.740 [ERROR]   
HeapAsyncSnapshotTtlStateTest>TtlStateTestBase.testMultipleKeysWithSnapshotCleanup:325->TtlStateTestBase.testMultipleStateIds:388
 Expired state should be unavailable expected:<null> but was:<7>
   04:50:53.740 [ERROR]   
HeapAsyncSnapshotTtlStateTest>TtlStateTestBase.testMultipleKeysWithSnapshotCleanup:325->TtlStateTestBase.testMultipleStateIds:388
 Expired state should be unavailable expected:<[]> but was:<[4=4, 25=null, 
15=15]>
   04:50:53.740 [ERROR]   
HeapAsyncSnapshotTtlStateTest>TtlStateTestBase.testMultipleKeysWithSnapshotCleanup:325->TtlStateTestBase.testMultipleStateIds:388
 Expired state should be unavailable expected:<null> but was:<test value3>
   04:50:53.740 [ERROR]   
HeapAsyncSnapshotTtlStateTest>TtlStateTestBase.testMultipleKeysWithSnapshotCleanup:325->TtlStateTestBase.testMultipleStateIds:388
 Expired state should be unavailable expected:<[]> but was:<[1, 4]>
   ```
   
   log details: https://travis-ci.org/apache/flink/jobs/535110884

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to