claudevdm commented on code in PR #39028:
URL: https://github.com/apache/beam/pull/39028#discussion_r3544890590


##########
sdks/python/apache_beam/io/gcp/bigquery_tools.py:
##########
@@ -358,6 +360,12 @@ class BigQueryWrapper(object):
 
   HISTOGRAM_METRIC_LOGGER = MetricLogger()
 
+  # Shared by wrapper instances within one Python SDK worker process.
+  _TABLE_DEFINITION_CACHE_MAX_ENTRIES = 256
+  _TABLE_DEFINITION_CACHE_TTL_SECS = 60 * 60
+  _table_definition_cache = collections.OrderedDict()

Review Comment:
   Consider using cachetools.TTLCache instead of hand-rolled cache?



##########
sdks/python/apache_beam/io/gcp/bigquery_tools.py:
##########
@@ -358,6 +360,12 @@ class BigQueryWrapper(object):
 
   HISTOGRAM_METRIC_LOGGER = MetricLogger()
 
+  # Shared by wrapper instances within one Python SDK worker process.
+  _TABLE_DEFINITION_CACHE_MAX_ENTRIES = 256
+  _TABLE_DEFINITION_CACHE_TTL_SECS = 60 * 60

Review Comment:
   I think TTL should be 1 sec. See 
https://github.com/apache/beam/pull/34135#discussion_r1979513786



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to