Github user StefanRRichter commented on a diff in the pull request:
https://github.com/apache/flink/pull/4026#discussion_r119348235
--- Diff:
flink-core/src/test/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerTest.java
---
@@ -606,6 +665,45 @@ public void
testSerializerSerializationFailureResilience() throws Exception {
verifyPojoSerializerConfigSnapshotWithEmptyNestedSerializers(config,
deserializedConfig);
}
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testNonDuplicatedStatelessSerializersInConfigSnapshot()
throws IOException {
+ PojoSerializer<TestUserClassWithSameFieldTypes> pojoSerializer
= (PojoSerializer<TestUserClassWithSameFieldTypes>)
+
TypeExtractor.getForClass(TestUserClassWithSameFieldTypes.class).createSerializer(new
ExecutionConfig());
+
+ // snapshot configuration and serialize to bytes
+
PojoSerializer.PojoSerializerConfigSnapshot<TestUserClassWithSameFieldTypes>
config = pojoSerializer.snapshotConfiguration();
+ byte[] serializedConfig;
+ try (
+ ByteArrayOutputStream out = new
ByteArrayOutputStream()) {
+
TypeSerializerSerializationUtil.writeSerializerConfigSnapshot(new
DataOutputViewStreamWrapper(out), config);
+ serializedConfig = out.toByteArray();
+ }
+
+ // read configuration from bytes
+ PojoSerializer.PojoSerializerConfigSnapshot<TestUserClass>
deserializedConfig;
+ try(ByteArrayInputStream in = new
ByteArrayInputStream(serializedConfig)) {
--- End diff --
There is also a `ByteArrayInputStreamWithPos`.
---
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.
---