RustedBones commented on a change in pull request #16271:
URL: https://github.com/apache/beam/pull/16271#discussion_r771257284



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/coders/AvroCoder.java
##########
@@ -272,26 +263,8 @@ public Schema get() {
     }
   }
 
-  /**
-   * A {@link Serializable} object that lazily supplies a {@link ReflectData} 
built from the
-   * appropriate {@link ClassLoader} for the type encoded by this {@link 
AvroCoder}.
-   */
-  private static class SerializableReflectDataSupplier
-      implements Serializable, Supplier<ReflectData> {
-
-    private final Class<?> clazz;
-
-    private SerializableReflectDataSupplier(Class<?> clazz) {
-      this.clazz = clazz;
-    }
-
-    @Override
-    public ReflectData get() {
-      ReflectData reflectData = new ReflectData(clazz.getClassLoader());
-      reflectData.addLogicalTypeConversion(new JodaTimestampConversion());
-      return reflectData;
-    }
-  }
+  private final AvroSource.DatumReaderFactory<T> readerFactory;
+  private final AvroSink.DatumWriterFactory<T> writerFactory;

Review comment:
       Ideally I would have liked to have those as constructor parameter.
   As explained in the PR comment, this causes problem with the 
[`AvroCoderCloudObjectTranslator`](https://github.com/apache/beam/blob/master/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/AvroCoderCloudObjectTranslator.java)
 which serializes the `AvroCoder` in a CloudObject (json). I don't know how to 
serialize the factories in that case 




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