tzulitai commented on a change in pull request #7590: [FLINK-11329][core]
Migrating CompositeSerializers
URL: https://github.com/apache/flink/pull/7590#discussion_r252139206
##########
File path:
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RowSerializer.java
##########
@@ -260,73 +262,80 @@ private void readObject(ObjectInputStream in) throws
IOException, ClassNotFoundE
}
//
--------------------------------------------------------------------------------------------
- // Serializer configuration snapshotting & compatibility
+ // Serializer configuration snapshoting & compatibility
//
--------------------------------------------------------------------------------------------
@Override
- public RowSerializerConfigSnapshot snapshotConfiguration() {
- return new RowSerializerConfigSnapshot(fieldSerializers);
+ public TypeSerializerSnapshot<Row> snapshotConfiguration() {
+ return new RowSerializerSnapshot(this);
}
- @Override
- public CompatibilityResult<Row>
ensureCompatibility(TypeSerializerConfigSnapshot<?> configSnapshot) {
- if (configSnapshot instanceof RowSerializerConfigSnapshot) {
- List<Tuple2<TypeSerializer<?>,
TypeSerializerSnapshot<?>>> previousFieldSerializersAndConfigs =
- ((RowSerializerConfigSnapshot)
configSnapshot).getNestedSerializersAndConfigs();
-
- if (previousFieldSerializersAndConfigs.size() ==
fieldSerializers.length) {
- boolean requireMigration = false;
- TypeSerializer<?>[] convertDeserializers = new
TypeSerializer<?>[fieldSerializers.length];
-
- CompatibilityResult<?> compatResult;
- int i = 0;
- for (Tuple2<TypeSerializer<?>,
TypeSerializerSnapshot<?>> f : previousFieldSerializersAndConfigs) {
- compatResult =
CompatibilityUtil.resolveCompatibilityResult(
- f.f0,
-
UnloadableDummyTypeSerializer.class,
- f.f1,
- fieldSerializers[i]);
-
- if (compatResult.isRequiresMigration())
{
- requireMigration = true;
-
- if
(compatResult.getConvertDeserializer() == null) {
- // one of the field
serializers cannot provide a fallback deserializer
- return
CompatibilityResult.requiresMigration();
- } else {
- convertDeserializers[i]
=
- new
TypeDeserializerAdapter<>(compatResult.getConvertDeserializer());
- }
- }
+ /**
+ * A snapshot for {@link RowSerializer}.
+ */
Review comment:
nit: Add `@deprecated` message.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services