Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/413#discussion_r25086445
  
    --- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/typeutils/runtime/AvroSerializer.java
 ---
    @@ -91,7 +98,22 @@ public T createInstance() {
        @Override
        public T copy(T from) {
                checkKryoInitialized();
    -           return this.kryo.copy(from);
    +           try {
    +                   return this.kryo.copy(from);
    +           } catch(KryoException ke) {
    +                   // kryo was unable to copy it, so we do it through 
serialization:
    +                   ByteArrayOutputStream baout = new 
ByteArrayOutputStream();
    +                   Output output = new Output(baout);
    +
    +                   kryo.writeObject(output, from);
    +
    +                   output.close();
    +
    +                   ByteArrayInputStream bain = new 
ByteArrayInputStream(baout.toByteArray());
    +                   Input input = new Input(bain);
    +
    +                   return (T)kryo.readObject(input, from.getClass());
    --- End diff --
    
    Which cases do we cover with this method?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to