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