tzulitai commented on a change in pull request #6467: [FLINK-9887] Ensure
serializer upgrades work with timer service remake
URL: https://github.com/apache/flink/pull/6467#discussion_r207156336
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/state/InternalPriorityQueueTestBase.java
##########
@@ -489,14 +496,62 @@ public int hashCode() {
return 4711;
}
+ protected int getRevision() {
+ return REVISION;
+ }
+
@Override
public TypeSerializerConfigSnapshot snapshotConfiguration() {
- throw new UnsupportedOperationException();
+ return new Snapshot(getRevision());
}
@Override
public CompatibilityResult<TestElement>
ensureCompatibility(TypeSerializerConfigSnapshot configSnapshot) {
- throw new UnsupportedOperationException();
+ return (configSnapshot instanceof Snapshot) &&
((Snapshot) configSnapshot).revision <= getRevision() ?
+ CompatibilityResult.compatible() :
CompatibilityResult.requiresMigration();
+ }
+
+ public static class Snapshot extends
TypeSerializerConfigSnapshot {
+
+ private int revision;
+
+ public Snapshot() {
+ }
+
+ public Snapshot(int revision) {
+ this.revision = revision;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return obj instanceof Snapshot;
Review comment:
check `revision` in `equals` method
----------------------------------------------------------------
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