lookup cache clarification

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

lookup cache clarification

Marco Villalobos-2
I set up the following lookup cache values:

'lookup.cache.max-rows' = '200000'
'lookup.cache.ttl' = '1min'

for a jdbc connector.

This table currently only has about 20000 records in it. However,
since I set the TTL to 1 minute, I expected the job to query that
table every minute.

The documentation states:

https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/connectors/jdbc.html#lookup-cache

The oldest rows in cache will be expired when the cache hit to the max
cached rows lookup.cache.max-rows or when the row exceeds the max time
to live lookup.cache.ttl.

What am I misunderstanding?
Reply | Threaded
Open this post in threaded view
|

Re: lookup cache clarification

Danny Chan-2
Yes, you understand it correctly.

Marco Villalobos <[hidden email]> 于2020年12月9日周三 上午4:23写道:
I set up the following lookup cache values:

'lookup.cache.max-rows' = '200000'
'lookup.cache.ttl' = '1min'

for a jdbc connector.

This table currently only has about 20000 records in it. However,
since I set the TTL to 1 minute, I expected the job to query that
table every minute.

The documentation states:

https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/connectors/jdbc.html#lookup-cache

The oldest rows in cache will be expired when the cache hit to the max
cached rows lookup.cache.max-rows or when the row exceeds the max time
to live lookup.cache.ttl.

What am I misunderstanding?
Reply | Threaded
Open this post in threaded view
|

Re: lookup cache clarification

Marco Villalobos-2
But when I monitor my database, it only shows one query.  It does not show a query every 20 seconds. It seems that since the cache is 10 times larger that the records are kept even though they expired.

On Dec 9, 2020, at 4:05 AM, Danny Chan <[hidden email]> wrote:

Yes, you understand it correctly.

Marco Villalobos <[hidden email]> 于2020年12月9日周三 上午4:23写道:
I set up the following lookup cache values:

'lookup.cache.max-rows' = '200000'
'lookup.cache.ttl' = '1min'

for a jdbc connector.

This table currently only has about 20000 records in it. However,
since I set the TTL to 1 minute, I expected the job to query that
table every minute.

The documentation states:

https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/connectors/jdbc.html#lookup-cache

The oldest rows in cache will be expired when the cache hit to the max
cached rows lookup.cache.max-rows or when the row exceeds the max time
to live lookup.cache.ttl.

What am I misunderstanding?