-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Allow users to specify trusted Avro serializable classes to Dataflow worker #36809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
de88282
e027e2d
83a8513
7cf5b2c
afb1461
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -276,6 +276,14 @@ func main() { | |
| args = append(args, "--add-modules="+module.GetStringValue()) | ||
| } | ||
| } | ||
| // Add trusted Avro serializable classes | ||
| if serializableClasses, ok := pipelineOptions.GetStructValue().GetFields()["avroSerializableClasses"]; ok { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could have both; a default that matches avro and this option to override when needed. Ideally the avro default list should be public so users can extend/modify it as required.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, for classes already caused regressions ("java.math.BigDecimal", and if there are others) we can add it here for users |
||
| var serializableClassesSlice []string | ||
| for _, cls := range serializableClasses.GetListValue().GetValues() { | ||
| serializableClassesSlice = append(serializableClassesSlice, cls.GetStringValue()) | ||
| } | ||
| args = append(args, "-Dorg.apache.avro.SERIALIZABLE_CLASSES="+strings.Join(serializableClassesSlice, ",")) | ||
| } | ||
| } | ||
| // Automatically open modules for Java 11+ | ||
| openModuleAgentJar := "/opt/apache/beam/jars/open-module-agent.jar" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said this should be an "SDKHarnessOptions": https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/options/SdkHarnessOptions.java