Abacn commented on code in PR #33979:
URL: https://github.com/apache/beam/pull/33979#discussion_r1955147604
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/ConvertHelpers.java:
##########
@@ -57,9 +61,20 @@
"rawtypes"
})
public class ConvertHelpers {
- private static class SchemaInformationProviders {
- private static final ServiceLoader<SchemaInformationProvider> INSTANCE =
- ServiceLoader.load(SchemaInformationProvider.class);
+
+ private static final AtomicReference<List<SchemaInformationProvider>>
+ SCHEMA_INFORMATION_PROVIDERS = new AtomicReference<>();
+
+ private static List<SchemaInformationProvider>
getSchemaInformationProviders() {
+ return SCHEMA_INFORMATION_PROVIDERS.updateAndGet(
Review Comment:
this makes List<SchemaInformationProvider> only update once. I'm not sure if
it is possible if iterating over "SchemaInformationProviders.INSTANCE" would
return different values overtime currently
forwarding to experts who I remember reviewed / fixed concurrency issues R:
@scwhittle @kennknowles thanks!
--
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]