beyond1920 commented on a change in pull request #9010: [FLINK-13114]
[table-planner-blink] adapt blink planner to new unified TableEnvironment
URL: https://github.com/apache/flink/pull/9010#discussion_r300966937
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableConfig.scala
##########
@@ -286,35 +285,35 @@ class TableConfig {
def getLateFireInterval: Long = lateFireInterval
/**
- * Gets the specified name of the initial catalog to be created when
instantiating
- * a [[TableEnvironment]].
- */
- def getBuiltInCatalogName: String = builtInCatalogName
-
- /**
- * Specifies the name of the initial catalog to be created when
instantiating
- * a [[TableEnvironment]]. This method has no effect if called on the
- * [[TableEnvironment#getConfig()]].
- */
- def setBuiltInCatalogName(builtInCatalogName: String): Unit = {
- this.builtInCatalogName = builtInCatalogName
- }
-
- /**
- * Gets the specified name of the default database in the initial catalog
to be created when
- * instantiating a [[TableEnvironment]].
- */
- def getBuiltInDatabaseName: String = builtInDatabaseName
-
- /**
- * Specifies the name of the default database in the initial catalog to be
created when
- * instantiating a [[TableEnvironment]]. This method has no effect if
called on the
- * [[TableEnvironment#getConfig()]].
+ * Specifies a minimum and a maximum 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 minimum
time and will never
+ * be kept if it was idle for more than the maximum 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 minTime The minimum time interval for which idle state is
retained. Set to 0 (zero) to
+ * never clean-up the state.
+ * @param maxTime The maximum time interval for which idle state is
retained. Must be at least
+ * 5 minutes greater than minTime. Set to 0 (zero) to never clean-up the
state.
*/
- def setBuiltInDatabaseName(builtInDatabaseName: String): Unit = {
- this.builtInDatabaseName = builtInDatabaseName
+ def setIdleStateRetentionTime(minTime: Time, maxTime: Time): Unit = {
+ if (maxTime.toMilliseconds - minTime.toMilliseconds < 300000 &&
+ !(maxTime.toMilliseconds == 0) && minTime.toMilliseconds == 0) {
+ throw new IllegalArgumentException(
+ "Difference between minTime: " + minTime.toString + " and maxTime: " +
maxTime.toString +
+ "should be at least 5 minutes.")
+ }
+ minIdleStateRetentionTime = minTime.toMilliseconds
+ maxIdleStateRetentionTime = maxTime.toMilliseconds
Review comment:
SetIdleStateRetentionTime should be updated with
getMinIdleStateRetentionTime/ getMaxIdleStateRetentionTime together.
----------------------------------------------------------------
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