fsk119 commented on a change in pull request #12880:
URL: https://github.com/apache/flink/pull/12880#discussion_r465679070
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableConfig.java
##########
@@ -286,20 +276,43 @@ public void setIdleStateRetentionTime(Time minTime, Time
maxTime) {
}
minIdleStateRetentionTime = minTime.toMilliseconds();
maxIdleStateRetentionTime = maxTime.toMilliseconds();
+
setIdleStateRetentionDuration(Duration.ofMillis(minIdleStateRetentionTime));
+ }
+
+ /**
+ * Specifies a retention time interval for how long idle state, i.e.,
state which
+ * was not updated, will be retained.
+ * State will never be cleared until it was idle for less than the
retention time and will never
+ * be kept if it was idle for more than the 1.5 * retention time.
+ *
+ * <p>When new data arrives for previously cleaned-up state, the new
data will be handled as if it
+ * was the first data. This can result in previous results being
overwritten.
+ *
+ * <p>Set to 0 (zero) to never clean-up the state.
+ *
+ * <p>NOTE: Cleaning up state requires additional bookkeeping which
becomes less expensive for
+ * larger differences of minTime and maxTime. The difference between
minTime and maxTime must be
+ * at least 5 minutes.
+ *
+ * @param duration The retention time interval for which idle state is
retained. Set to 0 (zero) to
+ * never clean-up the state.
+ */
+ public void setIdleStateRetentionDuration(Duration duration){
Review comment:
If we use the same function name with different parametere list, it will
get strange thing on python side. We can only use one of the
`setIdleStateRetentionTime` in python. So the only option is to use the method
name `setIdleStateRetention`
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableConfig.java
##########
@@ -286,20 +276,43 @@ public void setIdleStateRetentionTime(Time minTime, Time
maxTime) {
}
minIdleStateRetentionTime = minTime.toMilliseconds();
maxIdleStateRetentionTime = maxTime.toMilliseconds();
+
setIdleStateRetentionDuration(Duration.ofMillis(minIdleStateRetentionTime));
+ }
+
+ /**
+ * Specifies a retention time interval for how long idle state, i.e.,
state which
+ * was not updated, will be retained.
+ * State will never be cleared until it was idle for less than the
retention time and will never
+ * be kept if it was idle for more than the 1.5 * retention time.
+ *
+ * <p>When new data arrives for previously cleaned-up state, the new
data will be handled as if it
+ * was the first data. This can result in previous results being
overwritten.
+ *
+ * <p>Set to 0 (zero) to never clean-up the state.
+ *
+ * <p>NOTE: Cleaning up state requires additional bookkeeping which
becomes less expensive for
+ * larger differences of minTime and maxTime. The difference between
minTime and maxTime must be
+ * at least 5 minutes.
+ *
+ * @param duration The retention time interval for which idle state is
retained. Set to 0 (zero) to
+ * never clean-up the state.
Review comment:
If we use the same function name with different parametere list, it will
get strange thing on python side. We can only use one of the
`setIdleStateRetentionTime` in python. So the only option is to use the method
name `setIdleStateRetention`
----------------------------------------------------------------
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]