[
https://issues.apache.org/jira/browse/FLINK-2432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14655019#comment-14655019
]
ASF GitHub Bot commented on FLINK-2432:
---------------------------------------
Github user rmetzger commented on a diff in the pull request:
https://github.com/apache/flink/pull/962#discussion_r36280519
--- Diff:
flink-staging/flink-language-binding/flink-language-binding-generic/src/main/java/org/apache/flink/languagebinding/api/java/common/streaming/Sender.java
---
@@ -253,6 +257,18 @@ public ByteBuffer serialize(T value) {
public abstract void serializeInternal(T value);
}
+ private class CustomTypeSerializer extends
Serializer<CustomTypeWrapper> {
+ public CustomTypeSerializer() {
+ super(0);
+ }
+ @Override
+ public void serializeInternal(CustomTypeWrapper value) {
+ byte[] bytes = value.getData();
+ buffer = ByteBuffer.allocate(bytes.length);
--- End diff --
I guess you can use `ByteBuffer.wrap()` to avoid allocating an additional
byte array for every custom type?
> [py] Provide support for custom serialization
> ---------------------------------------------
>
> Key: FLINK-2432
> URL: https://issues.apache.org/jira/browse/FLINK-2432
> Project: Flink
> Issue Type: New Feature
> Components: Python API
> Reporter: Chesnay Schepler
> Assignee: Chesnay Schepler
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)