This is an automated email from the ASF dual-hosted git repository. tzulitai pushed a commit to branch release-1.8 in repository https://gitbox.apache.org/repos/asf/flink.git
commit 6b85529fe791e58d1a5427a896b999a05365832b Author: Tzu-Li (Gordon) Tai <tzuli...@apache.org> AuthorDate: Mon Feb 25 11:59:56 2019 +0800 [FLINK-11741] [core] Add getNestedSerializerSnapshots utility method in CompositeTypeSerializerConfigSnapshot We often want to get only the restored serializer snapshots from a legacy CompostieTypeSerializerConfigSnapshot when attempting to redirect compatibility checks to new snapshots. This commit adds a getNestedSerializerSnapshots utility method for that purpose. --- .../common/typeutils/CompositeTypeSerializerConfigSnapshot.java | 7 +++++++ ...nTest.java => MigratedNFASerializerSnapshotsMigrationTest.java} | 0 2 files changed, 7 insertions(+) diff --git a/flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerConfigSnapshot.java b/flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerConfigSnapshot.java index 237c7ce..51ff77d 100644 --- a/flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerConfigSnapshot.java +++ b/flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerConfigSnapshot.java @@ -77,6 +77,13 @@ public abstract class CompositeTypeSerializerConfigSnapshot<T> extends TypeSeria return nestedSerializersAndConfigs.get(0); } + public TypeSerializerSnapshot<?>[] getNestedSerializerSnapshots() { + return nestedSerializersAndConfigs + .stream() + .map(nestedSerializerAndConfig -> nestedSerializerAndConfig.f1) + .toArray(TypeSerializerSnapshot[]::new); + } + @Override public boolean equals(Object obj) { if (obj == this) { diff --git a/flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/NFASerializerSnapshotsMigrationTest.java b/flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/MigratedNFASerializerSnapshotsMigrationTest.java similarity index 100% rename from flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/NFASerializerSnapshotsMigrationTest.java rename to flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/MigratedNFASerializerSnapshotsMigrationTest.java