Skip to content

Commit

Permalink
[hotfix] [cep] Fix incorrect CompatibilityResult.requiresMigration ca…
Browse files Browse the repository at this point in the history
…lls in CEP
  • Loading branch information
tzulitai committed Jun 13, 2017
1 parent b216a4a commit 8d0c4c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.util.Preconditions;

import javax.annotation.Nonnull;

/**
* A {@code CompatibilityResult} contains information about whether or not data migration
* is required in order to continue using new serializers for previously serialized data.
Expand Down Expand Up @@ -60,10 +62,10 @@ public static <T> CompatibilityResult<T> compatible() {
*
* @return a result that signals migration is necessary, also providing a convert deserializer.
*/
public static <T> CompatibilityResult<T> requiresMigration(TypeDeserializer<T> convertDeserializer) {
public static <T> CompatibilityResult<T> requiresMigration(@Nonnull TypeDeserializer<T> convertDeserializer) {
Preconditions.checkNotNull(convertDeserializer, "Convert deserializer cannot be null.");

return new CompatibilityResult<>(true, Preconditions.checkNotNull(convertDeserializer));
return new CompatibilityResult<>(true, convertDeserializer);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ public CompatibilityResult<NFA<T>> ensureCompatibility(TypeSerializerConfigSnaps
}
}

return CompatibilityResult.requiresMigration(null);
return CompatibilityResult.requiresMigration();
}

private void serializeStates(Set<State<T>> states, DataOutputView out) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ public CompatibilityResult<SharedBuffer<K, V>> ensureCompatibility(TypeSerialize
}
}

return CompatibilityResult.requiresMigration(null);
return CompatibilityResult.requiresMigration();
}
}

Expand Down

0 comments on commit 8d0c4c0

Please sign in to comment.