Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-29887

Lookup cache in JDBC table connector is not each process (i.e. TaskManager) will hold a cache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • None
    • None
    • Connectors / JDBC
    • None

    Description

      hi~ I saw the description of "When lookup cache is enabled, each process (i.e. TaskManager) will hold a cache" on the website. When I print out the hashCode of cache in each slot’s thread, I find that they are inconsistent. But according to the above website‘s instructions, cache's hashCode should be the same.

      The context for verification is local IDEA.

      Can you help me explain? thks~

       

      //org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction # eval()  add a line of code: 
      LOG.info("cache hashCode is: {}", cache);
      
      
      //log
      2022-11-04 17:22:53,118 INFO  org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction [Source: daily[1] -> Calc[2] -> LookupJoin[3] -> Calc[4] -> ConstraintEnforcer[5] (8/8)#0] [] - cache hashCode is: org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache@656ae7d9
      2022-11-04 17:22:53,118 INFO  org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction [Source: daily[1] -> Calc[2] -> LookupJoin[3] -> Calc[4] -> ConstraintEnforcer[5] (6/8)#0] [] - cache hashCode is: org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache@5c3a31c2
      2022-11-04 17:22:53,118 INFO  org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction [Source: daily[1] -> Calc[2] -> LookupJoin[3] -> Calc[4] -> ConstraintEnforcer[5] (5/8)#0] [] - cache hashCode is: org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache@598a856e
      2022-11-04 17:22:53,118 INFO  org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction [Source: daily[1] -> Calc[2] -> LookupJoin[3] -> Calc[4] -> ConstraintEnforcer[5] (7/8)#0] [] - cache hashCode is: org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache@765328ef
      2022-11-04 17:22:53,118 INFO  org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction [Source: daily[1] -> Calc[2] -> LookupJoin[3] -> Calc[4] -> ConstraintEnforcer[5] (3/8)#0] [] - cache hashCode is: org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache@47f36967
      2022-11-04 17:22:53,118 INFO  org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction [Source: daily[1] -> Calc[2] -> LookupJoin[3] -> Calc[4] -> ConstraintEnforcer[5] (1/8)#0] [] - cache hashCode is: org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache@2b2ea2f
      2022-11-04 17:22:53,118 INFO  org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction [Source: daily[1] -> Calc[2] -> LookupJoin[3] -> Calc[4] -> ConstraintEnforcer[5] (4/8)#0] [] - cache hashCode is: org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache@1901ad34
      2022-11-04 17:22:53,118 INFO  org.apache.flink.connector.jdbc.table.JdbcRowDataLookupFunction [Source: daily[1] -> Calc[2] -> LookupJoin[3] -> Calc[4] -> ConstraintEnforcer[5] (2/8)#0] [] - cache hashCode is: org.apache.flink.shaded.guava30.com.google.common.cache.LocalCache$LocalManualCache@6c441f09
       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            leen linweijiang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: