You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Marco Villalobos <mv...@kineteque.com> on 2020/12/08 20:22:00 UTC

lookup cache clarification

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?

Re: lookup cache clarification

Posted by Marco Villalobos <mv...@kineteque.com>.
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 <da...@apache.org> wrote:
> 
> Yes, you understand it correctly.
> 
> Marco Villalobos <mvillalobos@kineteque.com <ma...@kineteque.com>> 于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 <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?


Re: lookup cache clarification

Posted by Danny Chan <da...@apache.org>.
Yes, you understand it correctly.

Marco Villalobos <mv...@kineteque.com> 于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?
>