Skip to content

Commit 6248fd4

Browse files
authored
[FLINK-33921][table] Cleanup deprecated IdleStateRetentionTime related method in org.apache.flink.table.api.TableConfig
This closes #23980
1 parent fbf532e commit 6248fd4

File tree

5 files changed

+2
-76
lines changed

5 files changed

+2
-76
lines changed

flink-python/pyflink/table/table_config.py

-30
Original file line numberDiff line numberDiff line change
@@ -226,36 +226,6 @@ def set_idle_state_retention(self, duration: datetime.timedelta):
226226
j_duration = j_duration_class.ofMillis(long(round(duration.total_seconds() * 1000)))
227227
self._j_table_config.setIdleStateRetention(j_duration)
228228

229-
def get_min_idle_state_retention_time(self) -> int:
230-
"""
231-
State might be cleared and removed if it was not updated for the defined period of time.
232-
233-
.. note::
234-
235-
Currently the concept of min/max idle state retention has been deprecated and only
236-
idle state retention time is supported. The min idle state retention is regarded as
237-
idle state retention and the max idle state retention is derived from idle state
238-
retention as 1.5 x idle state retention.
239-
240-
:return: The minimum time until state which was not updated will be retained.
241-
"""
242-
return self._j_table_config.getMinIdleStateRetentionTime()
243-
244-
def get_max_idle_state_retention_time(self) -> int:
245-
"""
246-
State will be cleared and removed if it was not updated for the defined period of time.
247-
248-
.. note::
249-
250-
Currently the concept of min/max idle state retention has been deprecated and only
251-
idle state retention time is supported. The min idle state retention is regarded as
252-
idle state retention and the max idle state retention is derived from idle state
253-
retention as 1.5 x idle state retention.
254-
255-
:return: The maximum time until state which was not updated will be retained.
256-
"""
257-
return self._j_table_config.getMaxIdleStateRetentionTime()
258-
259229
def get_idle_state_retention(self) -> datetime.timedelta:
260230
"""
261231

flink-python/pyflink/table/tests/test_table_config.py

-9
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@
2323

2424

2525
class TableConfigTests(PyFlinkTestCase):
26-
def test_get_set_idle_state_retention_time(self):
27-
table_config = TableConfig.get_default()
28-
29-
table_config.set_idle_state_retention_time(
30-
datetime.timedelta(days=1), datetime.timedelta(days=2))
31-
32-
self.assertEqual(3 * 24 * 3600 * 1000 / 2, table_config.get_max_idle_state_retention_time())
33-
self.assertEqual(24 * 3600 * 1000, table_config.get_min_idle_state_retention_time())
34-
3526
def test_get_set_idle_state_rentention(self):
3627
table_config = TableConfig.get_default()
3728

flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableConfig.java

-28
Original file line numberDiff line numberDiff line change
@@ -411,34 +411,6 @@ public void setIdleStateRetention(Duration duration) {
411411
configuration.set(ExecutionConfigOptions.IDLE_STATE_RETENTION, duration);
412412
}
413413

414-
/**
415-
* NOTE: Currently the concept of min/max idle state retention has been deprecated and only idle
416-
* state retention time is supported. The min idle state retention is regarded as idle state
417-
* retention and the max idle state retention is derived from idle state retention as 1.5 x idle
418-
* state retention.
419-
*
420-
* @return The minimum time until state which was not updated will be retained.
421-
* @deprecated use{@link getIdleStateRetention} instead.
422-
*/
423-
@Deprecated
424-
public long getMinIdleStateRetentionTime() {
425-
return configuration.get(ExecutionConfigOptions.IDLE_STATE_RETENTION).toMillis();
426-
}
427-
428-
/**
429-
* NOTE: Currently the concept of min/max idle state retention has been deprecated and only idle
430-
* state retention time is supported. The min idle state retention is regarded as idle state
431-
* retention and the max idle state retention is derived from idle state retention as 1.5 x idle
432-
* state retention.
433-
*
434-
* @return The maximum time until state which was not updated will be retained.
435-
* @deprecated use{@link getIdleStateRetention} instead.
436-
*/
437-
@Deprecated
438-
public long getMaxIdleStateRetentionTime() {
439-
return getMinIdleStateRetentionTime() * 3 / 2;
440-
}
441-
442414
/**
443415
* @return The duration until state which was not updated will be retained.
444416
*/

flink-table/flink-table-api-scala-bridge/src/test/scala/org/apache/flink/table/api/bridge/scala/internal/StreamTableEnvironmentImplTest.scala

+2-4
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ class StreamTableEnvironmentImplTest {
4848
val table = tEnv.fromDataStream(elements)
4949
tEnv.toDataStream(table)
5050

51-
assertThat(tEnv.getConfig.getMinIdleStateRetentionTime).isEqualTo(retention.toMillis)
52-
assertThat(tEnv.getConfig.getMaxIdleStateRetentionTime).isEqualTo(retention.toMillis * 3 / 2)
51+
assertThat(tEnv.getConfig.getIdleStateRetention.toMillis).isEqualTo(retention.toMillis)
5352
}
5453

5554
@Test
@@ -63,8 +62,7 @@ class StreamTableEnvironmentImplTest {
6362
val table = tEnv.fromDataStream(elements)
6463
tEnv.toRetractStream[Row](table)
6564

66-
assertThat(tEnv.getConfig.getMinIdleStateRetentionTime).isEqualTo(retention.toMillis)
67-
assertThat(tEnv.getConfig.getMaxIdleStateRetentionTime).isEqualTo(retention.toMillis * 3 / 2)
65+
assertThat(tEnv.getConfig.getIdleStateRetention.toMillis).isEqualTo(retention.toMillis)
6866
}
6967

7068
private def getStreamTableEnvironment(

flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/utils/TableConfigUtils.java

-5
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ public static ZoneId getLocalTimeZone(ReadableConfig tableConfig) {
105105
return ZoneId.of(zone);
106106
}
107107

108-
/**
109-
* Similar to {@link TableConfig#getMaxIdleStateRetentionTime()}.
110-
*
111-
* @see TableConfig#getMaxIdleStateRetentionTime()
112-
*/
113108
@Deprecated
114109
public static long getMaxIdleStateRetentionTime(ReadableConfig tableConfig) {
115110
return tableConfig.get(ExecutionConfigOptions.IDLE_STATE_RETENTION).toMillis() * 3 / 2;

0 commit comments

Comments
 (0)