Abacn commented on code in PR #36809:
URL: https://github.com/apache/beam/pull/36809#discussion_r2535393626


##########
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/options/DataflowPipelineOptions.java:
##########
@@ -266,4 +267,30 @@ public String create(PipelineOptions options) {
   List<String> getJdkAddOpenModules();
 
   void setJdkAddOpenModules(List<String> options);
+
+  class AvroSerializableClassesFactory implements 
DefaultValueFactory<List<String>> {
+    @Override
+    public List<String> create(PipelineOptions options) {
+      return Arrays.asList(
+          "java.math.BigDecimal",
+          "java.math.BigInteger",
+          "java.net.URI",
+          "java.net.URL",
+          "java.io.File",
+          "java.lang.Integer");
+    }
+  }
+
+  /**
+   * The Avro spec supports the `java-class` schema annotation, which allows 
fields to be serialized
+   * and deserialized via their toString/String constructor. As of Avro 
1.11.4+, allowed Java
+   * classes must be explicitly specified via the jvm option. The 
comma-separated String value of
+   * this pipeline option will be passed to the Dataflow worker via the
+   * -Dorg.apache.avro.SERIALIZABLE_CLASSES jvm option.
+   */
+  @Description("Serializable classes required by java-class props in Avro 
1.11.4+")
+  @Default.InstanceFactory(AvroSerializableClassesFactory.class)
+  List<String> getAvroSerializableClasses();
+
+  void setAvroSerializableClasses(List<String> options);

Review Comment:
   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



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