StefanRRichter commented on a change in pull request #6875: [FLINK-9808] [state 
backends] Migrate state when necessary in state backends
URL: https://github.com/apache/flink/pull/6875#discussion_r227708622
 
 

 ##########
 File path: 
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBListState.java
 ##########
 @@ -242,6 +244,36 @@ public void addAll(List<V> values) {
                }
        }
 
+       @Override
+       public void migrateSerializedValue(
+                       DataInputDeserializer serializedOldValueInput,
+                       DataOutputSerializer serializedMigratedValueOutput,
+                       TypeSerializer<List<V>> priorSerializer,
+                       TypeSerializer<List<V>> newSerializer) throws 
StateMigrationException {
+
+               Preconditions.checkArgument(priorSerializer instanceof 
ListSerializer);
+               Preconditions.checkArgument(newSerializer instanceof 
ListSerializer);
+
+               TypeSerializer<V> priorElementSerializer =
+                       ((ListSerializer<V>) 
priorSerializer).getElementSerializer();
+
+               TypeSerializer<V> newElementSerializer =
+                       ((ListSerializer<V>) 
newSerializer).getElementSerializer();
+
+               try {
+                       while (serializedOldValueInput.available() > 0) {
 
 Review comment:
   Why can't we use `deserializeNextElement` for the read part and instead 
duplicate some of the code?

----------------------------------------------------------------
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

Reply via email to