flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StefanRRichter <...@git.apache.org>
Subject [GitHub] flink pull request #3937: [FLINK-6482] [core] Add nested serializers to conf...
Date Mon, 22 May 2017 10:14:45 GMT
Github user StefanRRichter commented on a diff in the pull request:

    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerConfigSnapshot.java
    @@ -19,47 +19,65 @@
     package org.apache.flink.api.common.typeutils;
     import org.apache.flink.annotation.Internal;
    +import org.apache.flink.api.java.tuple.Tuple2;
     import org.apache.flink.core.memory.DataInputView;
     import org.apache.flink.core.memory.DataOutputView;
     import org.apache.flink.util.Preconditions;
     import java.io.IOException;
    -import java.util.Arrays;
    +import java.util.ArrayList;
    +import java.util.List;
      * A {@link TypeSerializerConfigSnapshot} for serializers that has multiple nested serializers.
    - * The configuration snapshot consists of the configuration snapshots of all nested serializers.
    + * The configuration snapshot consists of the configuration snapshots of all nested serializers,
    + * also the nested serializers themselves.
    + *
    + * <p>Both the nested serializers and the configuration snapshots are written as
configuration of
    + * composite serializers, so that on restore, the previous serializer may be used in
case migration
    + * is required.
     public abstract class CompositeTypeSerializerConfigSnapshot extends TypeSerializerConfigSnapshot
    -	private TypeSerializerConfigSnapshot[] nestedSerializerConfigSnapshots;
    +	private List<Tuple2<TypeSerializer<?>, TypeSerializerConfigSnapshot>>
     	/** This empty nullary constructor is required for deserializing the configuration.
     	public CompositeTypeSerializerConfigSnapshot() {}
    -	public CompositeTypeSerializerConfigSnapshot(TypeSerializerConfigSnapshot... nestedSerializerConfigSnapshots)
    -		this.nestedSerializerConfigSnapshots = Preconditions.checkNotNull(nestedSerializerConfigSnapshots);
    +	public CompositeTypeSerializerConfigSnapshot(TypeSerializer<?>... nestedSerializers)
    +		Preconditions.checkNotNull(nestedSerializers);
    +		this.nestedSerializersWithConfigs = new ArrayList<>(nestedSerializers.length);
    +		TypeSerializerConfigSnapshot configSnapshot;
    --- End diff --
    I think this could go inside the loop.

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 infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message