-
|
Hi @jnioche, I've been exploring the codebase to better understand how the enrichment modules work, specifically looking at the I noticed that the private static Set<String> unknownInstanceTypes;I have a question regarding the execution model: since Spark Executors typically run multiple tasks concurrently within the same JVM, wouldn’t these tasks share this static If so, is there a risk of I might be missing something about how the class is instantiated or isolated by the Spark executor, but if my understanding is correct, would it be safer to switch to (I also noticed the same pattern in Thanks for the clarification! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
thanks @davide954 |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @jnioche! I totally agree regarding the However, my main concern was actually about the This typically results in:
Since Is that reasonable for you? |
Beta Was this translation helpful? Give feedback.
-
|
Implemented in #148 |
Beta Was this translation helpful? Give feedback.
unknownInstanceTypesacts as a cache which is why I called it so :-)ConcurrentHashMap.newKeySet()is a relatively non-obtrusive fix, no reason not to do it! Feel free to open a PR, ideally covering other similar uses of Hashset in our code.Thanks @davide954