Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanRRichter committed Jan 25, 2017
1 parent ffe5278 commit 3133fd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Expand Up @@ -25,9 +25,16 @@
import java.io.IOException;
import java.io.Serializable;

/**
* The purpose of this class is the be filled in as a placeholder for the namespace serializer when migrating from
* Flink 1.1 savepoint (which did not include the namespace serializer) to Flink 1.2 (which always must include a
* (non-null) namespace serializer. This is then replaced as soon as the user is re-registering her state again for
* the first run under Flink 1.2 and provides again the real namespace serializer.
*/
@Deprecated
public class MigrationNamespaceSerializerProxy extends TypeSerializer<Serializable> {

public static MigrationNamespaceSerializerProxy INSTANCE = new MigrationNamespaceSerializerProxy();
public static final MigrationNamespaceSerializerProxy INSTANCE = new MigrationNamespaceSerializerProxy();

private static final long serialVersionUID = -707800010807094491L;

Expand All @@ -41,7 +48,8 @@ public boolean isImmutableType() {

@Override
public TypeSerializer<Serializable> duplicate() {
return new MigrationNamespaceSerializerProxy();
throw new UnsupportedOperationException(
"This is just a proxy used during migration until the real type serializer is provided by the user.");
}

@Override
Expand Down
Expand Up @@ -96,6 +96,7 @@ public boolean isCompatibleWith(RegisteredBackendStateMetaInfo<?, ?> other) {

return (stateSerializer.isCompatibleWith(other.stateSerializer)) &&
(namespaceSerializer.isCompatibleWith(other.namespaceSerializer)
// we also check if there is just a migration proxy that should be replaced by any real serializer
|| other.namespaceSerializer instanceof MigrationNamespaceSerializerProxy);
}

Expand Down

0 comments on commit 3133fd0

Please sign in to comment.