ibzib commented on a change in pull request #13835:
URL: https://github.com/apache/beam/pull/13835#discussion_r566518789
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/JavaUdfLoader.java
##########
@@ -57,7 +58,10 @@
* Maps the external jar location to the functions the jar defines. Static
so it can persist
* across multiple SQL transforms.
*/
- private static final Map<String, FunctionDefinitions> cache = new
HashMap<>();
+ private static final Map<String, FunctionDefinitions> functionCache = new
HashMap<>();
+
+ /** Maps potentially remote jar paths to their local file copies. */
+ private static final Map<String, File> jarCache = new HashMap<>();
Review comment:
I can only think of a couple ways the cache could contain handles to
nonexistent files:
- If the file was deleted somehow.
- If the cache was serialized and shipped to workers. But we don't include a
JavaUdfLoader instance as part of CalcFn, instead we construct a new
JavaUdfLoader instance in `CalcFn::setup`. Besides, the cache is a static
variable, and static variables are never serialized.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]